Skip to main content

History Project API Generator

This project generates a JSON API from the history-project content repository. It does that in two steps:

  • load: Generate a sqlite database from the source files.
  • dump: Use that database to generate a JSON API.

Endpoints

Usage

From source

  • Ensure you have Poetry installed.
  • Run poetry install.
  • Clone the history project repository into the content/ directory. You can do a shallow clone for this: GIT_LFS_SKIP_SMUDGE=1 git clone --depth 1 --branch master git@github.com:newtheatre/history-project content.
  • Run ./nthp load to generate the sqlite database from the content files.
  • Run ./nthp dump to generate the API from the database into the dist/ directory.

From PyPi

  • With pip installed run pip install --user nthp-api. If you have your local bin folder on your path you should now be able to run nthp.
  • Within the history-project repo run nthp load to generate the sqlite database from the content files.
  • Run nthp dump to generate the API from the database into the dist/ directory.

Alternatively you can run nthp build to run both steps in one go.

Contributing

pre-commit hooks

pre-commit hooks are used to lint the source code using Black and ruff

  • Ensure you have pre-commit installed.
  • Run pre-commit install to install pre-commit hooks.

Tests

Run pytest or use the included PyCharm run configuration.

Release

See the bin/release.sh script for the release process. This assumes that your local machine has the correct credentials to publish to PyPi.

Metadata

Release files for nthp_api 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nthp_api 0.1.7
File Size Uploaded
nthp_api-0.1.7.tar.gz 28.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nthp_api 0.1.7
File Interpreter ABI Platform
nthp_api-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 64.8 kB

Release files / nthp_api-0.1.7.tar.gz

Download URL nthp_api-0.1.7.tar.gz
Size 28.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9f496419cb3ec3c8ddcd63ead7336dbdfdad948da2e773ddd6555c5f629b6069
BLAKE2b-256 checksum
How to use checksums
9438de23c4310199cb14ae55a35c06e91457b28c59d5ce620cd3569be0a1cd9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.6 Linux/5.19.0-46-generic

Release files / nthp_api-0.1.7-py3-none-any.whl

Download URL nthp_api-0.1.7-py3-none-any.whl
Size 36.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d9f6619aafcc25a6fe3dc14329b1d657951e70a4a3e456fb9be485ab35b63db
BLAKE2b-256 checksum
How to use checksums
c7961300a8d59a759c8d009c3f176251c8be98212fd6c0b71934552b0e2796c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.6 Linux/5.19.0-46-generic

Release history Release notifications | RSS feed

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page