Skip to main content

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.

Metadata

Release files for silver-nitrate 1.8.1

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

Source distribution (sdist)

Source distribution for silver-nitrate 1.8.1
File Size Uploaded
silver_nitrate-1.8.1.tar.gz 20.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for silver-nitrate 1.8.1
File Interpreter ABI Platform
silver_nitrate-1.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 37.6 kB

Release files / silver_nitrate-1.8.1.tar.gz

Download URL silver_nitrate-1.8.1.tar.gz
Size 20.7 kB
Tags Source
SHA-256 checksum
How to use checksums
69b3cb0858df3c89006130725c8084c0656e71f32c076d58bcfe5d1d26c940c9
BLAKE2b-256 checksum
How to use checksums
33dfba6885eaebb0cad31e746ae615586f3425897de9fb8f28e049e9605fc68e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release files / silver_nitrate-1.8.1-py3-none-any.whl

Download URL silver_nitrate-1.8.1-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47629f216691c0c694958b825def9ba2a4f7eeace5628cbecc3ea9621954832b
BLAKE2b-256 checksum
How to use checksums
b13669839ba6435333052404c6963839c467a6362d727bd8d5f69429c08fd3c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release history Release notifications | RSS feed

This release

1.8.1 This release

2 release files

1.8.0

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

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