
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Simple zero-configuration retrieval of resources by URL.
This module provides a single geddit
function which takes a single parameter
specifying the URL to fetch. It will return a bytes
object with the contents
of the resource at that URL or will raise an exception specific to the URL
scheme.
This library is intended to be used in situations where scheme-specific
configuration can be inferred from the environment. (For example, in Google
Cloud-hosted environments there is usually a default identity which the services
run as. This identity will be used to fetch resources specified via the gs
or
sm
schemes.)
This library is not intended to replace general use libraries such as
requests
.
from geddit import geddit
# The default scheme is file://
geddit('file:///etc/issue') # == b'Debian GNU/Linux 10 \\n \\l\n\n'
geddit('/etc/issue') # == b'Debian GNU/Linux 10 \\n \\l\n\n'
geddit('./README.md') # Raises: ValueError
# Fetching using HTTP over TLS
geddit('https://www.gov.uk/bank-holidays.json')[:20] # == b'{"england-and-wales"'
# HTTP errors are reported
geddit('https://www.example.com/not-found') # raises requests.exceptions.HTTPError
# Google Storage objects. Uses default application credentials.
geddit('gs://my-bucket/some-object')
# Google Secret Manager secrets. Uses default application credentials.
geddit('sm://my-project/some-secret') # fetches latest version
geddit('sm://my-project/some-secret#3') # fetches version 3
# Data URLs.
geddit('data:application/x-yaml;charset=utf-8;base64,eyJmb28iOjF9') # == b'{"foo":1}'
The latest release of this library on PyPI
can be installed using pip
:
$ pip3 install geddit
The library can also be installed directly from the git repository if you want the most up-to-date version.
$ pip3 install git+https://gitlab.developers.cam.ac.uk/uis/devops/lib/geddit.git
For developers, the tool can be installed from a cloned repo using pip:
$ cd /path/to/this/repo
$ pip3 install -e .
See the guidebook section on publishing to PyPI for more information.
This software is licensed under an MIT-like software license. See the LICENSE file for the full text of the license.
The file
scheme is the default scheme. Only absolute paths can be specified.
There is no support for HTTP basic authentication as that involves putting the cleartext password into the URL.
Non-TLS ("http") URLs are not supported.
Only default application credentials are supported. To use specific credentials,
set the GOOGLE_APPLICATION_CREDENTIALS
environment variable to the absolute
path to some JSON-formatted credentials.
Data URLs are not good way of passing secrets since their values are transparent. They can be useful for transferring non-secret configuration or for use in development environments.
FAQs
Zero-configuration fetching of configuration resources
We found that geddit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.