Skip to main content

resourceful

Human friendly HTTP client for RESTful APIs

Usage

>>> import resourceful
>>> solaire = resourceful.API(url='https://api.le-systeme-solaire.net/rest')
>>> bodies = solaire.resource('bodies')
>>> bodies.url
'https://api.le-systeme-solaire.net/rest/bodies'
>>> solaire.bodies.url
'https://api.le-systeme-solaire.net/rest/bodies'
>>> # Perform get on https://api.le-systeme-solaire.net/rest/bodies to get all /bodies
>>> rsp = bodies.get()
>>> rsp.status_code
200
>>> rsp.json()
{
  "bodies": [
    {
      "id": "lune",
      "name": "La Lune",
      "englishName": "Moon",
      "isPlanet": false,
      "moons": null,
      "semimajorAxis": 384400,
      "perihelion": 363300,
      "aphelion": 405500,
      "eccentricity": 0.0549,
      "inclination": 5.145,
      "mass": {
        "massValue": 7.346,
        "massExponent": 22
      },
      "vol": {
        "volValue": 2.1968,
        "volExponent": 10
      },
      "density": 3.344,
      "gravity": 1.62,
      "escape": 2380,
...
>>> # Get resource by ID
>>> rsp = bodies.get('lune')
>>> rsp.status_code
200
>>> rsp.json()
{'id': 'lune', 'name': 'La Lune', 'englishName': 'Moon', 'isPlanet': False, 'moons': None, 'semimajorAxis': 384400, 'perihelion': 363300, 'aphelion': 405500, 'eccentricity': 0.0549, 'inclination': 5.145, 'mass': {'massValue': 7.346, 'massExponent': 22}, 'vol': {'volValue': 2.1968, 'volExponent': 10}, 'density': 3.344, 'gravity': 1.62, 'escape': 2380.0, 'meanRadius': 1737.0, 'equaRadius': 1738.1, 'polarRadius': 1736.0, 'flattening': 0.0012, 'dimension': '', 'sideralOrbit': 27.3217, 'sideralRotation': 655.728, 'aroundPlanet': {'planet': 'terre', 'rel': 'https://api.le-systeme-solaire.net/rest/bodies/terre'}, 'discoveredBy': '', 'discoveryDate': '', 'alternativeName': '', 'axialTilt': 6.68, 'avgTemp': 0, 'mainAnomaly': 0, 'argPeriapsis': 0, 'longAscNode': 0, 'bodyType': 'Moon'}
>>> # Perform get on https://api.le-systeme-solaire.net/rest/bodies with query parameters
>>> rsp = bodies.get(params={'data': 'id,name,isPlanet', 'filter[]': 'isPlanet,eq,true'})
>>> rsp.status_code
200
>>> rsp.json()
{'bodies': [{'id': 'uranus', 'name': 'Uranus', 'isPlanet': True}, {'id': 'neptune', 'name': 'Neptune', 'isPlanet': True}, {'id': 'jupiter', 'name': 'Jupiter', 'isPlanet': True}, {'id': 'mars', 'name': 'Mars', 'isPlanet': True}, {'id': 'mercure', 'name': 'Mercure', 'isPlanet': True}, {'id': 'saturne', 'name': 'Saturne', 'isPlanet': True}, {'id': 'terre', 'name': 'La Terre', 'isPlanet': True}, {'id': 'venus', 'name': 'Vénus', 'isPlanet': True}]}

Metadata

Release files for resourceful 0.1.4

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

Source distribution (sdist)

Source distribution for resourceful 0.1.4
File Size Uploaded Provenance Actions
resourceful-0.1.4.tar.gz 4.3 kB Without provenance Details for resourceful-0.1.4.tar.gz

Built distribution (wheel)

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

Total release size: 8.3 kB

Release files / resourceful-0.1.4.tar.gz

Download URL resourceful-0.1.4.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b4c8ede8e79231d2c9fe5638b59b325c5ac89722e87c024e12fd9b05856d360c
BLAKE2b-256 checksum
How to use checksums
bfb05f51f3a97d218a8593185a583177935d1b7159acf5f74fc013e8efcf704c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.0 CPython/3.8.10 Linux/5.15.0-48-generic

Release files / resourceful-0.1.4-py3-none-any.whl

Download URL resourceful-0.1.4-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e91ca81d09069e40bc5347913bb17695951ffd9580c92e87647a9376a02cb8b8
BLAKE2b-256 checksum
How to use checksums
ba4ba04c878c7647ec8026ea77c08bf17eedb99f0d5632e939d639f102f5c518
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.0 CPython/3.8.10 Linux/5.15.0-48-generic

Security for resourceful 0.1.4

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