Name | judge-pics JSON |
Version |
2.0.5
JSON |
| download |
home_page | |
Summary | Database of Judge Pictures |
upload_time | 2024-01-11 23:43:41 |
maintainer | Mike Lisser |
docs_url | None |
author | Mike Lissner |
requires_python | |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Welcome to the Judge Pics Repository
This is a collection of judicial portraits that works in tandem with the Free Law Project judicial portraits hosted photo service. You can use this system to integrate picture of judges directly into your applications.
Original files can be found in the `orig` directory.
## Using this Project
This system is exceedingly simple. To use it, install the judge pics package from pypi:
pip install judge-pics
And then use that package to get the URL of a judge's portrait. You can do that in one of two ways. You can look up the judge by name:
>>> from judge_pics.search import portrait, ImageSizes
>>> portrait("Ketanji Jackson", ImageSizes.SMALL)
'https://portraits.free.law/v2/128/jackson-ketanji-1970.jpeg'
Or if you know the CourtListener ID for that judge, that works too (and is more reliable). Ketanji Jackson is ID 1609, so:
>>> portrait(1609, ImageSizes.SMALL)
'https://portraits.free.law/v2/128/jackson-ketanji-1970.jpeg'
Now that you have the URL of the judge's photo in a useful size, just embed it in your application. Perhaps:
```html
<img src="'https://portraits.free.law/v2/128/jackson-ketanji-1970.jpeg"
height=128 />
```
One thing we don't currently do is provide a consistent width for the photos. This is because our sources are not consistent, and we opted to set the height consistently instead of the width. You can work around this by using the `width` attribute of the `img` tag instead of the `height` (in which case the browser will scale it for you), or by just ignoring the `width` attribute and letting the photo have slightly varying widths on your page.
Simple enough. The URLs we provide you will be reliable, performant, secure, and permanent (see below for details).
You can request images in one of the following heights:
```python
class ImageSizes(Enum):
SMALL = 128
MEDIUM = 256
LARGE = 512
ORIGINAL = "orig"
```
Selecting `ImageSizes.ORIGINAL` will give you a link to the original image that we have in our collection. You might use this to make custom-sized images, say.
Finally, if you're debugging or playing around, you can get a feel for a picture by using the `show` function:
![Judge Jackson as ANSI escape codes](https://github.com/freelawproject/judge-pics/blob/main/show-jackson.png)
That's about it.
## FAQs
### How reliable is the service?
Very. It uses AWS S3 with CloudFront as a CDN. That gives us a LOT of nines.
### What about versioning?
Over time, we will be adding more photos to these collections. These will arrive as updates to the Python package and as new photos in the service. We expect these to be generally backwards compatible, but if we need to break compatibility, we will do so by bumping the Python package to version 3.x, and changing the URL of the images to contain v3 instead of v2.
We see no reason why past URLs will ever change, though we may clean up photos in place by doing better crops or supplying a more recent photo, etc.
### So this is a free service? Huh?
Hosting this service is cheap, so we're just going to do it. That said, collecting the images for this service and developing it is extremely expensive. Some of this work was supported by Pre/Dicta, but donations help offset our costs.
Please [donate][d] if this is useful to you.
### How secure is this?
Here's how we're thinking about it.
**1. What prevents the images from being replaced with malicious ones?**
The short answer is that our incentives are aligned with yours. Because our website uses this same service, it would be difficult for an attacker to put malicious photos on your website without them also appearing on ours. This service is included in our [vulnerability disclosure policy][vdp], and we use process and technical measures to prevent incidents.
Because this service is hosted on S3, we do not manage servers and do not have to worry about things like expired HTTPS certificates, server vulnerabilities, etc.
In browsers, there is some discussion of a way to use cryptographic signatures to ensure the integrity of hotlinked images, but the feature has not seen much support. ([We're trying to nudge it along.][spec])
**2. What private information would we share with Free Law Project by using these services?**
Two pieces of data are shared with us:
1. The IP address of your users.
2. The URL and/or domain of your website via `referer` headers.
Ideally, we wouldn't get either of these pieces of information, but we at least need the IP so we can serve the request. We do not log it.
For the referrer, you can avoid sharing it with us by setting the [`Referrer-Policy`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy) header on your website. You should probably do this anyway.
**3. What if Free Law Project is hacked? Could that hack me too?**
The short answer is "not really." If you're using the `<img>` tag to put judge portraits or court seals on your website, the worst a hacker can do is change those photos. That's not great but the hacker couldn't deliver malicious javascript to your users, couldn't access private information from your website, etc. Hotlinking photos is as old as the Web itself and remains generally secure.
## Contributing as a Developer
This project is fairly easy to contribute to, and we need lots of help gathering files. You can see untapped sources for images in the [additional-sources.md][add] file.
The normal process is:
1. Find an image and ensure it follows our quality guidelines (below).
1. Add the image file to the `orig` directory.
Pictures are given the name of the judge and are of in the form:
$last-$first.jpeg
Noting that:
- the name is lowercase.
- the extension is `jpeg`, not `jpg`.
- any punctuation marks in a judge's name should be converted to
a dash, according to [Django's slugify function][slugify].
For example:
oconnor-sandra.jpeg
Some judges may have multiple great portraits. For those, omit the date of
birth and place a number after their name such as:
sotomayor-sonia-2.jpeg
We have also begun collecting group pictures. For these, the pattern is:
group-$court.jpeg
Noting that:
- `$court` corresponds to the CourtListener code for the court.
If you are unsure what code to use, you can [easily look it up on
CourtListener][codes].
- Again, the extension is `jpeg`, not `jpg`.
1. Once you have the picture ready, run `python update.py --help` and it'll guide you through the process of updating `people.json`.
## Quality Guidelines
1. Images should be a head and shoulders shot of the judge.
1. Images must be `jpeg` file format.
1. Pictures of painted portraits are often skewed and often show the wall where
the portrait is hung. Before submitting, de-skew the image and crop out
any bits of wall that you can see around the edges.
## New Releases
New releases are fairly seldom. When they happen, the version number is bumped in setup.py, and a new tag matching that version number is added to git. When it's pushed, images are automatically uploaded to S3 and a new release is pushed to PyPi.
## A Note to Judges
If you're a judge looking at this, and you want your picture to be included too, you can contribute it yourself using the guidelines in this readme. We enthusiastically encourage you to do so.
Alternatively, if you prefer, you can [send us an email using the contact form on the Free Law Project website][contact], and we'll be happy to do it for you.
Either way, we'd be elated to hear from you.
## Copyright
Two things. First, if you are creating original work, please consider signing
and emailing a contributor license to us so that we may protect the work later,
if needed.
Second, if you're just curious about the copyright of this repository, see the
License file for details. The license of individual images is described in
`people.json`.
[add]: https://github.com/freelawproject/judge-pics/blob/master/additional-sources.md
[slugify]: https://docs.djangoproject.com/en/1.8/_modules/django/utils/text/#slugify
[contact]: http://free.law/contact/
[codes]: https://www.courtlistener.com/api/jurisdictions/
[d]: https://free.law/donate/
[spec]: https://github.com/w3c/webappsec-subresource-integrity/issues/113
Raw data
{
"_id": null,
"home_page": "",
"name": "judge-pics",
"maintainer": "Mike Lisser",
"docs_url": null,
"requires_python": "",
"maintainer_email": "info@free.law",
"keywords": "",
"author": "Mike Lissner",
"author_email": "info@free.law",
"download_url": "https://files.pythonhosted.org/packages/70/42/9af11aa07a398a01fb48c787205a8b66d5e026dca5751728bde6f9b3b6ac/judge-pics-2.0.5.tar.gz",
"platform": null,
"description": "\n# Welcome to the Judge Pics Repository\n\nThis is a collection of judicial portraits that works in tandem with the Free Law Project judicial portraits hosted photo service. You can use this system to integrate picture of judges directly into your applications.\n\nOriginal files can be found in the `orig` directory.\n\n\n## Using this Project\n\nThis system is exceedingly simple. To use it, install the judge pics package from pypi:\n\n pip install judge-pics\n\nAnd then use that package to get the URL of a judge's portrait. You can do that in one of two ways. You can look up the judge by name:\n\n >>> from judge_pics.search import portrait, ImageSizes\n >>> portrait(\"Ketanji Jackson\", ImageSizes.SMALL)\n 'https://portraits.free.law/v2/128/jackson-ketanji-1970.jpeg'\n\nOr if you know the CourtListener ID for that judge, that works too (and is more reliable). Ketanji Jackson is ID 1609, so:\n\n >>> portrait(1609, ImageSizes.SMALL)\n 'https://portraits.free.law/v2/128/jackson-ketanji-1970.jpeg' \n\nNow that you have the URL of the judge's photo in a useful size, just embed it in your application. Perhaps:\n\n```html\n<img src=\"'https://portraits.free.law/v2/128/jackson-ketanji-1970.jpeg\" \n height=128 />\n```\n\nOne thing we don't currently do is provide a consistent width for the photos. This is because our sources are not consistent, and we opted to set the height consistently instead of the width. You can work around this by using the `width` attribute of the `img` tag instead of the `height` (in which case the browser will scale it for you), or by just ignoring the `width` attribute and letting the photo have slightly varying widths on your page.\n\nSimple enough. The URLs we provide you will be reliable, performant, secure, and permanent (see below for details).\n\nYou can request images in one of the following heights:\n\n```python\nclass ImageSizes(Enum):\n SMALL = 128\n MEDIUM = 256\n LARGE = 512\n ORIGINAL = \"orig\"\n```\n\nSelecting `ImageSizes.ORIGINAL` will give you a link to the original image that we have in our collection. You might use this to make custom-sized images, say.\n\nFinally, if you're debugging or playing around, you can get a feel for a picture by using the `show` function:\n\n![Judge Jackson as ANSI escape codes](https://github.com/freelawproject/judge-pics/blob/main/show-jackson.png)\n\nThat's about it.\n\n\n## FAQs\n\n### How reliable is the service?\n\nVery. It uses AWS S3 with CloudFront as a CDN. That gives us a LOT of nines.\n\n### What about versioning? \n\nOver time, we will be adding more photos to these collections. These will arrive as updates to the Python package and as new photos in the service. We expect these to be generally backwards compatible, but if we need to break compatibility, we will do so by bumping the Python package to version 3.x, and changing the URL of the images to contain v3 instead of v2.\n\nWe see no reason why past URLs will ever change, though we may clean up photos in place by doing better crops or supplying a more recent photo, etc.\n\n### So this is a free service? Huh?\n\nHosting this service is cheap, so we're just going to do it. That said, collecting the images for this service and developing it is extremely expensive. Some of this work was supported by Pre/Dicta, but donations help offset our costs.\n\nPlease [donate][d] if this is useful to you.\n\n### How secure is this?\n\nHere's how we're thinking about it.\n\n**1. What prevents the images from being replaced with malicious ones?**\n\nThe short answer is that our incentives are aligned with yours. Because our website uses this same service, it would be difficult for an attacker to put malicious photos on your website without them also appearing on ours. This service is included in our [vulnerability disclosure policy][vdp], and we use process and technical measures to prevent incidents.\n\nBecause this service is hosted on S3, we do not manage servers and do not have to worry about things like expired HTTPS certificates, server vulnerabilities, etc. \n\nIn browsers, there is some discussion of a way to use cryptographic signatures to ensure the integrity of hotlinked images, but the feature has not seen much support. ([We're trying to nudge it along.][spec])\n\n\n**2. What private information would we share with Free Law Project by using these services?**\n\nTwo pieces of data are shared with us:\n\n1. The IP address of your users.\n\n2. The URL and/or domain of your website via `referer` headers.\n\nIdeally, we wouldn't get either of these pieces of information, but we at least need the IP so we can serve the request. We do not log it.\n\nFor the referrer, you can avoid sharing it with us by setting the [`Referrer-Policy`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy) header on your website. You should probably do this anyway.\n\n\n**3. What if Free Law Project is hacked? Could that hack me too?**\n\nThe short answer is \"not really.\" If you're using the `<img>` tag to put judge portraits or court seals on your website, the worst a hacker can do is change those photos. That's not great but the hacker couldn't deliver malicious javascript to your users, couldn't access private information from your website, etc. Hotlinking photos is as old as the Web itself and remains generally secure.\n\n\n## Contributing as a Developer\n\nThis project is fairly easy to contribute to, and we need lots of help gathering files. You can see untapped sources for images in the [additional-sources.md][add] file.\n\nThe normal process is:\n\n1. Find an image and ensure it follows our quality guidelines (below).\n\n1. Add the image file to the `orig` directory.\n\n Pictures are given the name of the judge and are of in the form:\n\n $last-$first.jpeg\n\n Noting that:\n\n - the name is lowercase.\n - the extension is `jpeg`, not `jpg`.\n - any punctuation marks in a judge's name should be converted to\n a dash, according to [Django's slugify function][slugify].\n\n For example:\n\n oconnor-sandra.jpeg\n\n Some judges may have multiple great portraits. For those, omit the date of\n birth and place a number after their name such as:\n\n sotomayor-sonia-2.jpeg\n\n We have also begun collecting group pictures. For these, the pattern is:\n\n group-$court.jpeg\n\n Noting that:\n\n - `$court` corresponds to the CourtListener code for the court.\n If you are unsure what code to use, you can [easily look it up on\n CourtListener][codes].\n - Again, the extension is `jpeg`, not `jpg`.\n\n\n1. Once you have the picture ready, run `python update.py --help` and it'll guide you through the process of updating `people.json`.\n\n\n## Quality Guidelines\n\n1. Images should be a head and shoulders shot of the judge.\n1. Images must be `jpeg` file format.\n1. Pictures of painted portraits are often skewed and often show the wall where\n the portrait is hung. Before submitting, de-skew the image and crop out\n any bits of wall that you can see around the edges.\n\n\n## New Releases\n\nNew releases are fairly seldom. When they happen, the version number is bumped in setup.py, and a new tag matching that version number is added to git. When it's pushed, images are automatically uploaded to S3 and a new release is pushed to PyPi.\n\n\n## A Note to Judges\n\nIf you're a judge looking at this, and you want your picture to be included too, you can contribute it yourself using the guidelines in this readme. We enthusiastically encourage you to do so.\n\nAlternatively, if you prefer, you can [send us an email using the contact form on the Free Law Project website][contact], and we'll be happy to do it for you.\n\nEither way, we'd be elated to hear from you.\n\n\n## Copyright\n\nTwo things. First, if you are creating original work, please consider signing\nand emailing a contributor license to us so that we may protect the work later,\nif needed.\n\nSecond, if you're just curious about the copyright of this repository, see the\nLicense file for details. The license of individual images is described in\n`people.json`.\n\n\n[add]: https://github.com/freelawproject/judge-pics/blob/master/additional-sources.md\n[slugify]: https://docs.djangoproject.com/en/1.8/_modules/django/utils/text/#slugify\n[contact]: http://free.law/contact/\n[codes]: https://www.courtlistener.com/api/jurisdictions/\n[d]: https://free.law/donate/\n[spec]: https://github.com/w3c/webappsec-subresource-integrity/issues/113\n",
"bugtrack_url": null,
"license": "",
"summary": "Database of Judge Pictures",
"version": "2.0.5",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4270acd74a8f2d1cd56036f0a945c922668f1b53f18797cad0aa9f52c3daeda7",
"md5": "b7bde00b2880ee2ce73c159952d29d29",
"sha256": "f60f386f898daac3a067f0579daa33869be6d3923883bd9e626c759bbac631fa"
},
"downloads": -1,
"filename": "judge_pics-2.0.5-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "b7bde00b2880ee2ce73c159952d29d29",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 104268,
"upload_time": "2024-01-11T23:43:39",
"upload_time_iso_8601": "2024-01-11T23:43:39.904548Z",
"url": "https://files.pythonhosted.org/packages/42/70/acd74a8f2d1cd56036f0a945c922668f1b53f18797cad0aa9f52c3daeda7/judge_pics-2.0.5-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "70429af11aa07a398a01fb48c787205a8b66d5e026dca5751728bde6f9b3b6ac",
"md5": "b30ead5811be0e3dda421efc79482729",
"sha256": "9c17c7b5f4eb7407a606a59b11ae18724252cf176eab6e674d7e214d090dcdcc"
},
"downloads": -1,
"filename": "judge-pics-2.0.5.tar.gz",
"has_sig": false,
"md5_digest": "b30ead5811be0e3dda421efc79482729",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 105666,
"upload_time": "2024-01-11T23:43:41",
"upload_time_iso_8601": "2024-01-11T23:43:41.773805Z",
"url": "https://files.pythonhosted.org/packages/70/42/9af11aa07a398a01fb48c787205a8b66d5e026dca5751728bde6f9b3b6ac/judge-pics-2.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-11 23:43:41",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "judge-pics"
}