Skip to main content

similar-documents

Generates similarity document scores from cli. Useful when combined with static site generators.

$ similar-documents -h
usage: $ similar_documents -o result.json -k 5 -t japanese *.md
       $ similar_documents -h

positional arguments:
  documents             list[str]

optional arguments:
  -h, --help            show this help message and exit
  -o None, --output-file None
                        Optional: write output file (default STDOUT)
  -k 5, --top-k 5       Number of similar documents
  -d, --debug           Show debug messages
  -t None, --tokenizer None
                        tokenizer [japanese] (default None(space splitting))
  -e utf-8, --encoding utf-8
                        file encoding(default utf-8)
$ similar-documents -t japanese -k 2 /data/markdowns/recently/*.md | jq . | head -20
{
  "/data/markdowns/recently/2021-04-01.md": [
    [
      "/data/markdowns/recently/2021-04-26.md",
      0.3123780045484529
    ],
    [
      "/data/markdowns/recently/2021-04-03.md",
      0.17384380113610887
    ]
  ],
  "/data/markdowns/recently/2021-04-02.md": [
    [
      "/data/markdowns/recently/2021-04-26.md",
      0.10715535963136594
    ],
    [
      "/data/markdowns/recently/2021-04-23.md",
      0.09411751563901728
    ]

Installation

pip install -U similar-documents

On Docker

$ docker build -t similar-doc .
# examples: run on windows
$ docker run -it -v C:\Users\yu1\Dropbox\secon-sites\data:/data/ --rm similar-doc bash -c 'similar-documents -t japanese -k 2 -o /data/result.json `ls /data/markdowns/*/*.md`'

Lisence

MIT

Author

  • Yuichi Tateno

Metadata

Release files for similar-documents 0.1.4

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

Source distribution (sdist)

Source distribution for similar-documents 0.1.4
File Size Uploaded Provenance Actions
similar_documents-0.1.4.tar.gz 6.5 kB Without provenance Details for similar_documents-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for similar-documents 0.1.4
File Interpreter ABI Platform Actions
similar_documents-0.1.4-py3-none-any.whl Python 3 none any Details for similar_documents-0.1.4-py3-none-any.whl

Total release size: 14.9 kB

Release files / similar_documents-0.1.4.tar.gz

Download URL similar_documents-0.1.4.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
77df94b3cc8eadf2c2db74614864da6877d5d07fc3f7bca0de92364e3b40fcf9
BLAKE2b-256 checksum
How to use checksums
a6328a7fe7de8f51fac953df0b7dfef5d7aba05d1cc4062a2d1c134d40001dbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

Release files / similar_documents-0.1.4-py3-none-any.whl

Download URL similar_documents-0.1.4-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7498ce1e8adbfb5e10d6ae9e4a8f1f9227b89aa53425136f6fdef63a11788194
BLAKE2b-256 checksum
How to use checksums
e2c8724443b6fe68ff7ded4bba6e2e2e393cc5e69c7a9daac6579197ac67ed26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

Security for similar-documents 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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