Skip to content

Commit

Permalink
pyproject.toml & cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
robnagler committed Jul 29, 2024
1 parent d4bbf4f commit 512d6d5
Show file tree
Hide file tree
Showing 15 changed files with 301 additions and 616 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: python-ci
on:
pull_request:
branches:
- main
- master
push:
branches:
- main
- master

jobs:
python-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: curl -LsS https://radia.run | bash -s python-ci
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
MANIFEST.in
tox.ini
pytest.ini
pykern_setup.yaml
tox.ini
.python-version
.#*
\#*
.idea/
.vscode/

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down Expand Up @@ -45,9 +46,12 @@ pip-delete-this-directory.txt
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.pytest_cache

# Translations
*.mo
Expand Down
12 changes: 12 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Read The Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.9"
jobs:
pre_build:
- curl https://radia.run | bash -s readthedocs
sphinx:
configuration: docs/conf.py
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

601 changes: 202 additions & 399 deletions LICENSE

Large diffs are not rendered by default.

38 changes: 6 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,13 @@
### Photo Library Tools
### rnpix

For a demo, visit [rnpix.github.io](https://rnpix.github.io).
Photo library tools

The photo library is organized into "day" directories of the form
`YYYY/MM-DD/*.{jpg,mov,...}`. In each day directory, `index.txt`
contains:
Learn more at http://github.com/robnagler/rnpix.

```text
foo.jpg Some description for foo on one line
bar.mov A movie of something
```

The file may have comments with a `#` starting on the first character. (Historical version allows a `:` after the image name.)

The tools search `YY/MM-DD` directories to create `index.txt` and uses it to create a searchable, static HTML tree:

1. [identify](rnpix/pkcli/identify.py) appends to `index.txt` from the images in a day directory, prompting the user for each unidentified image.
2. [generate](rnpix/pkcli/generate.py) reads `index.txt` to create `index.html` and thumbnail directories `50` (pixel) and `200`, which are referenced in `index.html`
3. [indexer](rnpix/pkcli/indexer.py) reads `index.txt` to create `rnpix-index.js`, which is read by [rnindex](rnpix/package_data/static/rnindex.js) to find images by their description.
4. [fix](rnpix/pkcli/fix.py) reads `index.txt` and images in directory, and verifies and fixes the format.

#### Acknowledgements

Thanks to the excellent [js-search](https://github.com/cebe/js-search) by [Carsten Brandt](http://cebe.cc/about). It was first transliterated from the PHP
to Python, and then rewritten to match the picture indexing problem,
which was significantly different from the general HTML problem `js-search`
solves. I wouldn't have gotten the idea of how to implement a search
engine in Javascript without Carsten's project.

The rest of the code is all mine and evolved over a couple of decades
from a collection of simple Perl programs to be transformed this
year to Python.
Documentation: https://rnpix.readthedocs.io

#### License

License: http://www.apache.org/licenses/LICENSE-2.0.html
License: https://www.apache.org/licenses/LICENSE-2.0.html

Copyright (c) 2016 Robert Nagler. All Rights Reserved.
Copyright (c) 2024 Rob Nagler. All Rights Reserved.
4 changes: 4 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Welcome to rnpix

Photo library tools

.. autosummary::
:toctree: _autosummary
:recursive:

.. toctree::
:maxdepth: 2

Expand Down
37 changes: 37 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[build-system]
requires = ["chronver", "setuptools>=66"]
build-backend = "setuptools.build_meta"

[project]
authors = [
{ name = "Rob Nagler", email = "rnpix@robnagler.com" },
]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python",
"Topic :: Utilities",
]
dependencies = [
"exif",
"pykern",
]
description = "Photo library tools"
dynamic = ["version"]
name = "rnpix"
readme = "README.md"

[project.scripts]
rnpix = "rnpix.rnpix_console:main"

[project.urls]
Homepage = "http://github.com/robnagler/rnpix"

[tool.setuptools.package-data]
rnpix = ["package_data/**"]

[tool.setuptools.packages.find]
include = ["rnpix*"]
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

13 changes: 12 additions & 1 deletion rnpix/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
#
""":mod:`rnpix` package
:copyright: Copyright (c) 2024 Rob Nagler. All Rights Reserved.
:license: https://www.apache.org/licenses/LICENSE-2.0.html
"""
import pkg_resources

try:
# We only have a version once the package is installed.
__version__ = pkg_resources.get_distribution("rnpix").version
except pkg_resources.DistributionNotFound:
pass
23 changes: 0 additions & 23 deletions rnpix/base_pkconfig.py

This file was deleted.

2 changes: 1 addition & 1 deletion rnpix/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def _pid():
os.rmdir(lock_d)


def move_one(src, dst_root):
def move_one(src, dst_root=None):
e = src.ext.lower()
if e == ".jpeg":
e = ".jpg"
Expand Down
114 changes: 0 additions & 114 deletions rnpix/pkcli/picasa.py

This file was deleted.

11 changes: 4 additions & 7 deletions rnpix/rnpix_console.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
# -*- coding: utf-8 -*-
"""Front-end command line for :mod:`rnpix`.
See :mod:`pykern.pkcli` for how this module is used.
:copyright: Copyright (c) 2016 Rob Nagler. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
:copyright: Copyright (c) 2024 Rob Nagler. All Rights Reserved.
:license: https://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function

import pykern.pkcli
import sys

from pykern import pkcli


def main():
return pkcli.main("rnpix")
return pykern.pkcli.main("rnpix")


if __name__ == "__main__":
Expand Down
27 changes: 0 additions & 27 deletions setup.py

This file was deleted.

0 comments on commit 512d6d5

Please sign in to comment.