Skip to main content

sendero

Data Filtering for Humans

why sendero?

"sendero" means footpath in Spanish

install

pip install sendero

basic usage

# in JSON-compatible format
data = {
  "agency": "GSA",
  "measurementType": {
    "method": "modules"
  },
  "version": "2.0.0",
  "releases": [
    {
      "name": "usasearch",
      "description": "System now maintained in open repo https://github.com/GSA/search-gov.",
      "permissions": {
        "licenses": None,
        "usageType": "governmentWideReuse"
      },
      "tags": [
        "GSA"
      ]
    },
    # ...
  ]
}
from sendero import list_paths, get

list_paths(data, 'agency')
[
    "agency",
    "measurementType.method",
    "releases.contact.email",
    "releases.description",
    # ...
]

get(data, 'agency')
["GSA"]

# get nested properties using dot syntax
get(data, 'releases.permissions.licenses.name')
["CC0 1.0 Universal", "PD", "agpl-3.0", ... ]

# get nested properties using double underscore syntax
get(data, 'releases__permissions__licenses__name')
["CC0 1.0 Universal", "PD", "agpl-3.0", ... ]

advanced usage

clean

Filter out None and empty strings.

from sendero import get

# dirty
get(data, "releases.license", clean=False)
[ null, 'https://creativecommons.org/publicdomain/zero/1.0', None, None, ... ]

# clean
get(data, "releases.license", clean=True)
[ 'https://creativecommons.org/publicdomain/zero/1.0', 'https://github.com/GSA/open.gsa.gov/blob/gh-pages/TERMS.md', ... ]

unique

If you only want unique results returned:

# default
get(data, 'releases.tags')
["GSA", "GSA", "GSA", ...]

# uniques only
get(data, 'releases.tags', unique=True)
["GSA","gsa","socialmedia", "mobileapps", ...]

sort

If you want your results sorted

get(data, 'releases.tags', sort=True)
["508", "API", "Bing", "DigitalGovSearch", ...]

delimiter

By default, sendero tries syntax where the steps are separted by "." or "__". If you'd like to restrict the syntax or use a custom delimiter:

get(data, 'releases--tags', delimiter='--')

# accepts releases--tags and releases__tags
get(data, 'releases--tags', delimiter=['--', '__'])

stringify

# converts numbers to strings
get(data, "releases.laborHours", stringify=True, unique=True)
["0", "200", "12345" ]

# convert objects to JSON strings
get(data, "releases.permissions", stringify=True, unique=True)
[
  '{"licenses":null,"usageType":"governmentWideReuse"}',
  '{"licenses":[{"URL":"http://choosealicense.com/licenses/mit/","name":"mit"}],"usageType":"openSource"}',
  '{"licenses":[{"URL":"http://choosealicense.com/licenses/gpl-3.0/","name":"gpl-3.0"}],"usageType":"openSource"}',
  '{"licenses":null,"usageType":"openSource"}',
  # ...
]

Metadata

Release files for sendero 0.2.0

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

Source distribution (sdist)

Source distribution for sendero 0.2.0
File Size Uploaded Provenance Actions
sendero-0.2.0.tar.gz 6.6 kB Without provenance Details for sendero-0.2.0.tar.gz

Release files / sendero-0.2.0.tar.gz

Download URL sendero-0.2.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
17f6126fa994164d3be0ac14cd3f98ff3454af7b013e0a7a5d5aeb3dec3c6b2a
BLAKE2b-256 checksum
How to use checksums
cfddfab7e71cee19f8896a3da9d3dff2b21081c136034e8833012f1e2b866ba5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.0

Security for sendero 0.2.0

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