Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Amarillo

CRUD for carpool offers

An Amarillo is a yellow-dressed person helping others to find a car pool in Cuba.

Setup

  • Python 3.9.2 with pip
  • python3-venv

Create a virtual environment python3 -m venv venv.

Activate the environment and install the dependencies pip install -r requirements.txt.

Run uvicorn amarillo.main:app.

In development, you can use --reload.

Environment Variables

  • env
  • ADMIN_TOKEN

Security

All endpoints are protected by an API-Key in the HTTP header. There is a special admin user. For this user, the API-Key must be passed in as an environment variable when Amarillo is started.

The admin can create additional API-Keys in the /users endpoint. This endpoint is always available but not always shown in /docs, especially not when running in production. The Swagger docs for /users can be seen on the MFDZ demo server.

Permissions work this way

  • the admin is allowed to call all operations on all resources. Only the admin can create new API-Keys by POSTing an users JSON object to /users.
  • API-Keys for agencies are allowed to POST/PUT/GET/DELETE their own resources and GET some public resources.

Development

GTFS-RT python bindings

In case you modify or update the proto-files in amarillo/proto, you'll need to regenerate the python bindings. First, create the python files:

$ cd amarillo/proto
$ protoc --version
libprotoc 3.21.6
$ protoc --proto_path=. --python_out=../services/gtfsrt gtfs-realtime.proto realtime_extension.proto
$ sed 's/import gtfs_realtime_pb2/import amarillo.services.gtfsrt.gtfs_realtime_pb2/g' ../services/gtfsrt/realtime_extension_pb2.py | sponge ../services/gtfsrt/realtime_extension_pb2.py

Testing

In the top directory, run pytest amarillo/tests.

Docker

Based on tiangolo/uvicorn-gunicorn:python3.9-slim

  • build docker build -t amarillo --build-arg="PLUGINS=amarillo-metrics" .
  • run docker run --rm --name amarillo -p 8000:80 -e MAX_WORKERS="1" -e ADMIN_TOKEN=$ADMIN_TOKEN -e RIDE2GO_TOKEN=$RIDE2GO_TOKEN -e TZ=Europe/Berlin -v $(pwd)/data:/app/data amarillo

Metadata

Release files for amarillo 0.0.16a1

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

Source distribution (sdist)

Source distribution for amarillo 0.0.16a1
File Size Uploaded Provenance Actions
amarillo-0.0.16a1.tar.gz 50.2 kB Without provenance Details for amarillo-0.0.16a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for amarillo 0.0.16a1
File Interpreter ABI Platform Actions
amarillo-0.0.16a1-py3-none-any.whl Python 3 none any Details for amarillo-0.0.16a1-py3-none-any.whl

Total release size: 109.4 kB

Release files / amarillo-0.0.16a1.tar.gz

Download URL amarillo-0.0.16a1.tar.gz
Size 50.2 kB
Tags Source
SHA-256 checksum
How to use checksums
90c6fc260b2aeaf258eb596645bc8c74a4a34cb67bb7663d50aeb01fc1dd86a4
BLAKE2b-256 checksum
How to use checksums
e8a00aea29882f5c65d9af56bcc0188919cedfdd9850993f6fe73f223f2dd427
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.2

Release files / amarillo-0.0.16a1-py3-none-any.whl

Download URL amarillo-0.0.16a1-py3-none-any.whl
Size 59.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd2c9690f4db278e7ed4e301b83ad839af320043861b836949c95216c864a82c
BLAKE2b-256 checksum
How to use checksums
9fbc323d846c67f3db85c1df7fcaa945025fb045503c59af9efb2895f1e7db98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.2

Security for amarillo 0.0.16a1

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.

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