SpaceTimePandas
Location and date features from a bunch of api sources to Pandas. Repository hosted on GitHub.
pip install SpaceTimePandas
Temporal features
>>> import datetime
>>> from stpd.event import Holiday
>>> us_holidays = Holiday(years=[2021, 2022, 2023], country='US')
>>> us_holidays(datetime.date(2022, 1, 17))
{
'us_holiday_days_since_last': 0,
'us_holiday_days_to_next': 35
}
>>> from datetime import datetime
>>> from stpd.fourier import Fourier
>>> Fourier()(datetime(2020, 1, 1))
{
'week_of_year_sine_phase_0': 0.1198805403706726,
...
'week_of_year_sine_phase_52': 0.08569582503232778,
'week_of_year_cos_phase_0': 0.9927883238840168,
...
'minute_of_hour_cos_phase_59': 0.9945218953682733
}
>>> from stpd.nytsentiment import NYTimesSentiment
>>> from datetime import date
>>> nytsentiment = NYTimesSentiment(api_key='<GET-ONE-FROM-NYT-DEVELOPERS-API>')
>>> nytsentiment(date(2022, 6, 1))
{'negative': 0.04179099574685097, 'positive': 0.9582089781761169}
Location features
>>> from stpd.openstreetmap import OpenStreetMap
>>> osm=OpenStreetMap()('Toronto Ontario')
[nominatim] downloading data: search
{
'count_natural=tree': 719,
'count_natural=water': 15,
'count_building=yes': 1151,
'count_building=house': 39,
'count_amenity=parking': 148,
'count_amenity=restaurant': 327,
'count_service=driveway': 77
}
>>> from stpd.openrouteservice import OpenRouteServicePathFeatures
>>> ors = OpenRouteServicePathFeatures(api_key='<GET-ONE-FROM-OPENROUTESERVICE>')
>>> ors(location_strs=['toronto ontario', 'hamilton ontario'])
{
'distance': 67828.8,
'duration': 3125.3
}
>>> from stpd.openrouteservice import OpenRouteServiceLocationFeatures
>>> ors = OpenRouteServiceLocationFeatures(api_key='<GET-ONE-FROM-OPENROUTESERVICE>')
>>> ors(location_str='toronto ontario')
{
'range_seconds_100.0_area': 553988.44,
'range_seconds_100.0_reachfactor': 0.0229,
'range_seconds_100.0_total_pop': 1953.0,
'range_seconds_200.0_area': 3674992.8,
...
'range_seconds_1000.0_total_pop': 942521.0
}
Metadata
Release files for SpaceTimePandas 0.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| SpaceTimePandas-0.3.3.tar.gz | 28.5 kB | Without provenance | Details for SpaceTimePandas-0.3.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| SpaceTimePandas-0.3.3-py3-none-any.whl | Python 3 | none | any | Details for SpaceTimePandas-0.3.3-py3-none-any.whl |
Total release size: 39.1 kB
Release files / SpaceTimePandas-0.3.3.tar.gz
| Download URL | SpaceTimePandas-0.3.3.tar.gz |
|---|---|
| Size | 28.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
918c2eaa2924ee89d9d0eb686f5a26c9204b10816baf84061c805fd982ab323d
|
|
BLAKE2b-256 checksum How to use checksums |
e2a6c00b063411792363681fbdbff565fc533f11958bb5dc03bb9ade92be7257
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.13
|
Release files / SpaceTimePandas-0.3.3-py3-none-any.whl
| Download URL | SpaceTimePandas-0.3.3-py3-none-any.whl |
|---|---|
| Size | 10.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
75d83595f8f81ab23c703dce7d0cd9b6b8abe50f2bba48a7ac0fcf5595daab30
|
|
BLAKE2b-256 checksum How to use checksums |
66d65382dbf81dcf823dd133e16304e62d2c9dece8b27baa978dfc21329992aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.13
|
Security for SpaceTimePandas 0.3.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.