File | Date | Author | Commit |
---|---|---|---|
docs | 2024-10-12 |
![]() |
[82e3c1] Release 1.1 |
tests | 2024-10-09 |
![]() |
[380194] Changed the folder name separator and introduce... |
whintpy | 2024-12-20 |
![]() |
[18867c] deposit: re-organized logging for info/debug |
.gitignore | 2024-05-09 |
![]() |
[283b05] Added makedoc.py to create automatically the do... |
AUTHORS.md | 2024-10-12 |
![]() |
[82e3c1] Release 1.1 |
CODE_OF_CONDUCT.md | 2024-10-12 |
![]() |
[82e3c1] Release 1.1 |
CODE_STYLE_GUIDE.md | 2024-10-12 |
![]() |
[82e3c1] Release 1.1 |
LICENSE | 2024-05-09 |
![]() |
[4aa994] Added connection package: an authentication man... |
README.md | 2024-10-12 |
![]() |
[82e3c1] Release 1.1 |
codemeta.json | 2024-10-12 |
![]() |
[82e3c1] Release 1.1 |
makedoc.py | 2024-10-12 |
![]() |
[82e3c1] Release 1.1 |
pyproject.toml | 2024-10-12 |
![]() |
[82e3c1] Release 1.1 |
whintpy_add.py | 2024-09-28 |
![]() |
[b2f2a0] Added right-holder to copyright, highly simplif... |
-------------------------------------------------------------------------
██╗ ██╗ ██╗ ██╗ ██╗ ███╗ ██╗ ████████╗ ██████╗ ██╗ ██╗
██║ ██║ ██║ ██║ ██║ ████╗ ██║ ╚══██╔══╝ ██╔══██╗ ╚██╗ ██╔╝
██║ █╗ ██║ ███████║ ██║ ██╔██╗ ██║ ██║ ██████╔╝ ╚████╔╝
██║███╗██║ ██╔══██║ ██║ ██║╚██╗██║ ██║ ██╔═══╝ ╚██╔╝
╚███╔███╔╝ ██║ ██║ ██║ ██║ ╚████║ ██║ ██║ ██║
╚══╝╚══╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝
a Python library for managing shared files
Copyright (C) 2024 Laboratoire Parole et Langage, Aix-en-Provence, France
-------------------------------------------------------------------------
WhintPy is a pure Python-based solution for managing shared files locally or on a web server.
You have a web server that you want to use as a file server. You want all users in your local network to get access to all files stored in that server via web browser.
You then need a web-based file manager allowing any authenticated user to download or upload any file from anywhere via web browser.
You want a powerful solution to filter the list of available documents. WhintPy is the server-side of such a tool.
WhintPy is a pure Python, free, open-source, self-hosted library for managing shared files locally or on a web server.
It is a lightweight library which aims to allow users to upload, download, delete, and efficiently search files from anywhere without the need for any additional software.
It allows a web-site to deal with:
> python -m pip install WhintPy
Download the latest ".zip" from https://sourceforge.net/projects/whintpy/ and unpack it, or clone the repository with git
.
WhintPy package includes the following folders and files:
whintpy
library in Markdown> # Install from the zip archive:
> unzip WhintPy-xxx.zip
> # or with git:
> git clone https://git.code.sf.net/p/whakerpy/code whakerpy-code
> # Install both the required external libraries and WintPy in your python environment
> python -m pip install .
Create a document manager, add documents, and retrieve those matching some filter criteria by doing the following:
from whintpy.deposit import Document
>>> # Create several doc instances
>>> doc1 = Document("Sarah Connor", "Terminator's target.png", date=date.datetime(1984, 5, 12))
>>> doc2 = Document("T-800", "I'll be back.txt", date=date.datetime(1984, 5, 12))
>>> doc3 = Document("Skynet", "JudgementDay.TXT", date=date.datetime(1997, 8, 29))
>>> doc1.author
"Sarah-Connor"
>>> doc1.filename
"Terminators-target"
>>> doc3.filetype
"txt"
Add documents into a document manager:
>>> from whintpy.deposit import DocumentsManager
>>> manager = DocumentsManager("some_docs_path")
>>> manager.add_docs([doc1, doc2, doc3])
>>> # Add one more document directly to the manager
>>> doc4 = manager.add("Dani Ramos", "Dark Fate.txt", description="The Resistance sends Grace, an augmented soldier, back in time to defend Dani, who is also joined by Sarah Connor and Skynet's T-800.")
>>> # Get the most recent -- doc4
>>> most_recent = manager.get_docs_sorted_by_newest()[0]
>>> # Get the oldest -- either doc1 or doc2
>>> oldest = manager.get_docs_sorted_by_oldest()[0]
Retreive documents matching some criteria:
>> > from whintpy.deposit import DocumentsManager
>> > # Create a document manager and retrieve existing documents
>> > manager = DocumentsManager("some_docs_path")
>> > manager.collect_docs()
>> > # Get documents of date="1984-5-12" -- doc1 and doc2
>> > _docs = manager.filter(("date", "iexact", [datetime.date(1997, 8, 29)]))
>> > # Get documents of filetype "txt" -- doc2, doc3 and doc4
>> > _docs = manager.filter(("filetype", "exact", ["txt"]))
>> > # Get documents of both date="1984-5-12" and of filetype "txt" -- doc2
>> > _docs = manager.filter(("date", "iexact", [datetime.date(1997, 8, 29)], ("filetype", "exact", ["txt"])),
match_all=True)
The documents can also have a content - fortunately, a description, etc. They can be filtered with a large amount of criteria which can be combined together. And the API also allows to manage user's authentication to get a controlled access to the documents.
The API documentation is available in the docs
folder in Markdown format. HTML format is available on the web at https://whintpy.sourceforge.io.
To generate the documentation files, install the required external programs, then launch the doc generator:
>python -m pip install ".[docs]"
>python makedoc.py
Click the file docs/index.html
to browse throw the documented modules and classes.
If you plan to contribute to the code or to report a bug, please send an e-mail to the author.
Any and all constructive comments are welcome.
See the accompanying LICENSE
and AUTHORS.md
files for the full list of contributors.
Copyright (C) 2024 Brigitte Bigi, CNRS
Laboratoire Parole et Langage, Aix-en-Provence, France
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see https://www.gnu.org/licenses/.
Initial version of WhintPy, a Python library for managing shared files, which includes:
Same features as the initial version but with an optimized implementation.
todo: