Skip to content

Commit 88f6bfd

Browse files
committed
add pandas
1 parent bdd6074 commit 88f6bfd

File tree

8 files changed

+398
-3
lines changed

8 files changed

+398
-3
lines changed

.github/workflows/format.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
name: davidkhala.data.format
1+
name: davidkhala.data
22
on: push
33
jobs:
4-
tests:
4+
format:
55
runs-on: ubuntu-latest
66
steps:
77
- uses: actions/checkout@main
@@ -11,4 +11,13 @@ jobs:
1111
test-entry-point: pytest
1212
working-directory: format
1313
env:
14-
PRIVATE_KEY: ${{secrets.PRIVATE_KEY}}
14+
PRIVATE_KEY: ${{secrets.PRIVATE_KEY}}
15+
frame:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@main
19+
- uses: davidkhala/uv-buildpack@main
20+
with:
21+
tests: frame/tests
22+
test-entry-point: pytest
23+
working-directory: frame

frame/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
uv.lock

frame/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# pypi `davidkhala.data.frame`

frame/davidkhala/data/frame/pandas/__init__.py

Whitespace-only changes.

frame/pyproject.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[project]
2+
name = "davidkhala.data.frame"
3+
version = "0.0.5"
4+
description = ""
5+
authors = [{ name = "David Liu", email = "[email protected]" }]
6+
requires-python = "~=3.10"
7+
readme = "README.md"
8+
9+
[project.optional-dependencies]
10+
pandas = ["pandas"]
11+
polars = ["polars"]
12+
13+
[dependency-groups]
14+
dev = ["pytest", "duckdb"]
15+
16+
[tool.hatch.build.targets.sdist]
17+
include = ["davidkhala"]
18+
19+
[tool.hatch.build.targets.wheel]
20+
include = ["davidkhala"]
21+
22+
[build-system]
23+
requires = ["hatchling"]
24+
build-backend = "hatchling.build"

frame/tests/fixtures/airlines.csv

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
IATA_CODE,AIRLINE
2+
UA,United Air Lines Inc.
3+
AA,American Airlines Inc.
4+
US,US Airways Inc.
5+
F9,Frontier Airlines Inc.
6+
B6,JetBlue Airways
7+
OO,Skywest Airlines Inc.
8+
AS,Alaska Airlines Inc.
9+
NK,Spirit Air Lines
10+
WN,Southwest Airlines Co.
11+
DL,Delta Air Lines Inc.
12+
EV,Atlantic Southeast Airlines
13+
HA,Hawaiian Airlines Inc.
14+
MQ,American Eagle Airlines Inc.
15+
VX,Virgin America

frame/tests/fixtures/airports.csv

Lines changed: 323 additions & 0 deletions
Large diffs are not rendered by default.

frame/tests/pandas_test.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import unittest
2+
import pandas
3+
import duckdb
4+
5+
6+
class AirlineTestCase(unittest.TestCase):
7+
def test_import(self):
8+
df_airports = pandas.read_csv("fixtures/airports.csv")
9+
df_airlines = pandas.read_csv("fixtures/airlines.csv")
10+
11+
def test_duckDB(self):
12+
conn = duckdb.connect()
13+
14+
df_airports = pandas.read_csv("frame/tests/fixtures/airports.csv")
15+
conn.register("airports", df_airports)
16+
conn.close()
17+
18+
19+
20+
if __name__ == '__main__':
21+
unittest.main()

0 commit comments

Comments
 (0)