Skip to main content

Python utilities used by the Flickr Foundation

Project description

silver-nitrate

This is a collection of Python utilities used by the Flickr Foundation. It allows us to share certain functions and common code across all our projects.

Think of it as a souped-up version of utils.py.

This library is primarily for our use, but the code is fairly generic and may well be useful in other projects. If you want to use it, copy/paste the code (and the associated tests!) into your own project rather than adding a dependency on this library.

Builder's Photo of 2-8-0 Locomotive No 1402 "James Archbald," built in 1930 by the Delaware & Hudson Railroad. Scan of a silver-halide photo print. Photo from Bill Harrison on Flickr.

What's in this library?

This library contains shared functions that are a bit too complicated to copy/paste between different projects.

  • nitrate.cassettes -- pytest fixtures for working with vcrpy to record HTTP requests.
  • nitrate.flickr_login -- deal with the parts of the Flickr OAuth login process that are the same for every app.
  • nitrate.json -- encode/decode JSON in a type-preserving way.
  • nitrate.mock_passwords -- a pytest fixture to mock the keyring module.
  • nitrate.types -- helpers for validating Python types at runtime.
  • nitrate.xml -- type-safe helpers for finding matching elements or text in an XML document.

Why did you pick this name?

We wanted to pick a name that was:

  1. More interesting than "utils"
  2. Had a connection to photography
  3. Wasn't taken on PyPI

Silver nitrate was a key chemical in the early days of photography, especially in the 19th and early 20th centuries.

Photographers would coat glass plates with a mixture of chemicals, including silver nitrate. Because silver nitrate reacts when exposed to light, when you put the plate in a camera and open the shutter, different areas would react differently to create an image on the plate. You could then develop this plate into a photograph.

This code is key to our work at the Flickr Foundation, so it's a fitting name.

Development

If you want to make changes to the library, there are instructions in CONTRIBUTING.md.

License

This project is dual-licensed as Apache-2.0 and MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

silver_nitrate-1.8.1.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

silver_nitrate-1.8.1-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file silver_nitrate-1.8.1.tar.gz.

File metadata

  • Download URL: silver_nitrate-1.8.1.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for silver_nitrate-1.8.1.tar.gz
Algorithm Hash digest
SHA256 69b3cb0858df3c89006130725c8084c0656e71f32c076d58bcfe5d1d26c940c9
MD5 af56b969dda09a9efbf3997b2c4630d5
BLAKE2b-256 33dfba6885eaebb0cad31e746ae615586f3425897de9fb8f28e049e9605fc68e

See more details on using hashes here.

File details

Details for the file silver_nitrate-1.8.1-py3-none-any.whl.

File metadata

  • Download URL: silver_nitrate-1.8.1-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for silver_nitrate-1.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 47629f216691c0c694958b825def9ba2a4f7eeace5628cbecc3ea9621954832b
MD5 74554485f3e17c476e57fd86f9623839
BLAKE2b-256 b13669839ba6435333052404c6963839c467a6362d727bd8d5f69429c08fd3c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page