About
=====
This is my personal collection of snippets that I use in multiple projects.
Each one feels a bit to small to merit it's own library.
So what does it include?
* memoize decorator (caching)
* a storage class wrapping a dict.
* unittest assert functions.
* Functions for handling large JSON documents.
* list_dir(path) -> (dirnames, filenames)
* PID file locking
* A synchronization decorator
Note that many or all of these are old and that there is better alternatives these days.
Feedback and getting involved
-----------------------------
Send feedback and bug reports by email to hcs at furuvik dot net.
- Code Repository: https://gitlab.com/hcs/hcs_utils
News
====
2.1
------
*Release date: 2024-09-03*
* Removed versioneer because of lack of released Python 3.12 support.
* Switched to poetry based buildsystem.
* Misc non code updates
* ruff auto formatting
* Fixed errors and warnings reported by ruff and mypy
2.0
------
*Release date: 2015-09-14*
+ Now only supports Python 3.4
+ Improved thread safety for Lock
+ Bugfix for file handling i daemon
+ Code cleanup and some more tests
1.5
------
*Release date: 2014-02-11*
+ Added support to path.watch_files_callback for controlled shutdown
+ Lock, improved exception handling for edge case.
1.4
------
*Release date: 2013-11-19*
+ Fix for daemon, started even if it already was started.
1.4rc5
------
*Release date: 2013-04-16*
+ Fix for daemon sigterm handler
1.4rc4
------
*Release date: 2013-04-15*
+ Added logging to Daemon
1.4rc3
------
*Release date: 2013-04-11*
* fixed bug relating to daemon handle sigterm
* Added option to to force recalc of cached value for memoized call
1.4rc2
------
*Release date: 2013-03-21*
* Added unicode support to eq_str
1.4rc1
------
*Release date: 2012-11-16*
* Compatible with python 2.7 and 3.3
* Fixed problem in Lock, timeouts where not used when other thread in same process had the lock.
1.3
------
*Release date: 2012-11-10*
No changes since 1.3rc6
1.3rc6
------
*Release date: 2012--*
* Storage: added storagify and unstoragify (to/from json style data structure)
1.3rc5
------
*Release date: 2011-12-19*
* lock: Improved exception messages (added locking pid).
* lock: Added some debug logging.
1.3rc4
------
*Release date: 2011-09-13*
* Storage: Added generic support for key normalization.
1.3rc3
------
*Release date: 2011-09-06*
* Storage: Added support for running case_insensitive.
* Storage: Added support for default_factory.
1.3rc2
------
*Release date: 2011-08-25*
* Storage: Minor fixes
* daemon: A new module for creating a UNIX daemon.
* lock: Added the option to steal a lock.
1.3rc1
------
*Release date: 2011-07-11*
* PEP8 compliant
* Better test coverage
* added IDLock class to lock module
* Memoize optimization
* path.watch_file
1.3a9
-----
*Release date: 2011-05-31*
* Memoize: bugfixes
1.3a8
-----
*Release date: 2011-05-17*
* ItemStore: fixed bugs in rename and move
1.3a7
-----
*Release date: 2011-04-26*
* Memoize: Added support for instance methods
1.3a6
-----
*Release date: 2011-04-11*
* Added timeout to lockfile
1.3a5
-----
*Release date: 2011-04-06*
* Added locking to itemstore
* Added a file change watcher
* Some bugfixes
* PEP8 cleanup
1.3a4
-----
*Release date: 2011-02-11*
* Optimized Store.__contains__
* memoized functions can now be recursive
1.3a3
-----
* 1.3 will only support Python 2.6 and 2.7
* Testing using py.test instead of nose
* added hcs_utils.path.walkfiles() recursive file generator
* hcs_utils.itemstore Kind of on disk object/file/directory store
* some smaller functionality
* bunch of fixes
1.2
---
*Release date: 2011-01-07*
No changes since 1.2rc5
1.2.rc5
-------
*Release date: 2010-11-30*
* unittest.eq_json, sorted output so that it can be used with dicts.
* unittest switched place on ndiff arguments
1.2.rc4
-------
*Release date: 2010-06-15*
* Dropped support for Python 2.5
* Added hcs_utils.collections.ListBuilder, a nice way to manually build lists.
* Added hcs_utils.lock.Lock, Interprocess locking using a PID symlink.
* Added hcs_utils.path.scan_for_new_files()
* Added hcs_utils.path.tempdir context.
* Added hcs_utils.storage.Storage.\__contains__ and \__iter__
* Added hcs_utils.storage.json* Storage vs. json helpers
* Added hcs_utils.threading.synchronization decorator.
* Memoize is now thread safe.
* hcs_utils.path.list_dir now returns a namedtuple
1.1
---
*Release date: 2010-04-22*
* Fixed unpickeling of Storage objects.
1.0
---
*Release date: 2010-04-18*
* Initial release
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/hcs/hcs_utils",
"name": "hcs-utils",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.12",
"maintainer_email": null,
"keywords": null,
"author": "Christer Sj\u00f6holm",
"author_email": "1357-hcs@users.noreply.gitlab.com",
"download_url": "https://files.pythonhosted.org/packages/42/c4/8f3769cfa11b18bceb37292adc3b1b709578bd21d92543500644560238c2/hcs_utils-2.1.0.tar.gz",
"platform": null,
"description": "About\n=====\n\nThis is my personal collection of snippets that I use in multiple projects.\nEach one feels a bit to small to merit it's own library.\n\nSo what does it include?\n\n* memoize decorator (caching)\n* a storage class wrapping a dict.\n* unittest assert functions.\n* Functions for handling large JSON documents.\n* list_dir(path) -> (dirnames, filenames)\n* PID file locking\n* A synchronization decorator\n\nNote that many or all of these are old and that there is better alternatives these days.\n\nFeedback and getting involved\n-----------------------------\n\nSend feedback and bug reports by email to hcs at furuvik dot net.\n\n- Code Repository: https://gitlab.com/hcs/hcs_utils\n\nNews\n====\n\n2.1\n------\n*Release date: 2024-09-03*\n\n* Removed versioneer because of lack of released Python 3.12 support.\n* Switched to poetry based buildsystem.\n* Misc non code updates\n* ruff auto formatting\n* Fixed errors and warnings reported by ruff and mypy\n\n2.0\n------\n*Release date: 2015-09-14*\n\n+ Now only supports Python 3.4\n+ Improved thread safety for Lock\n+ Bugfix for file handling i daemon\n+ Code cleanup and some more tests\n\n\n1.5\n------\n*Release date: 2014-02-11*\n\n+ Added support to path.watch_files_callback for controlled shutdown\n+ Lock, improved exception handling for edge case.\n\n\n1.4\n------\n*Release date: 2013-11-19*\n\n+ Fix for daemon, started even if it already was started.\n\n1.4rc5\n------\n*Release date: 2013-04-16*\n\n+ Fix for daemon sigterm handler\n\n1.4rc4\n------\n*Release date: 2013-04-15*\n\n+ Added logging to Daemon\n\n1.4rc3\n------\n*Release date: 2013-04-11*\n\n* fixed bug relating to daemon handle sigterm\n* Added option to to force recalc of cached value for memoized call\n\n\n1.4rc2\n------\n*Release date: 2013-03-21*\n\n* Added unicode support to eq_str\n\n1.4rc1\n------\n*Release date: 2012-11-16*\n\n* Compatible with python 2.7 and 3.3\n* Fixed problem in Lock, timeouts where not used when other thread in same process had the lock.\n\n1.3\n------\n\n*Release date: 2012-11-10*\n\nNo changes since 1.3rc6\n\n1.3rc6\n------\n\n*Release date: 2012--*\n\n* Storage: added storagify and unstoragify (to/from json style data structure)\n\n1.3rc5\n------\n\n*Release date: 2011-12-19*\n\n* lock: Improved exception messages (added locking pid).\n* lock: Added some debug logging.\n\n1.3rc4\n------\n\n*Release date: 2011-09-13*\n\n* Storage: Added generic support for key normalization.\n\n1.3rc3\n------\n\n*Release date: 2011-09-06*\n\n* Storage: Added support for running case_insensitive.\n* Storage: Added support for default_factory.\n\n1.3rc2\n------\n\n*Release date: 2011-08-25*\n\n* Storage: Minor fixes\n* daemon: A new module for creating a UNIX daemon.\n* lock: Added the option to steal a lock.\n\n1.3rc1\n------\n\n*Release date: 2011-07-11*\n\n* PEP8 compliant\n* Better test coverage\n* added IDLock class to lock module\n* Memoize optimization\n* path.watch_file\n\n\n1.3a9\n-----\n\n*Release date: 2011-05-31*\n\n* Memoize: bugfixes\n\n1.3a8\n-----\n\n*Release date: 2011-05-17*\n\n* ItemStore: fixed bugs in rename and move\n\n1.3a7\n-----\n\n*Release date: 2011-04-26*\n\n* Memoize: Added support for instance methods\n\n\n1.3a6\n-----\n\n*Release date: 2011-04-11*\n\n* Added timeout to lockfile\n\n1.3a5\n-----\n\n*Release date: 2011-04-06*\n\n* Added locking to itemstore\n* Added a file change watcher\n* Some bugfixes\n* PEP8 cleanup\n\n1.3a4\n-----\n\n*Release date: 2011-02-11*\n\n* Optimized Store.__contains__\n* memoized functions can now be recursive\n\n1.3a3\n-----\n\n* 1.3 will only support Python 2.6 and 2.7\n* Testing using py.test instead of nose\n* added hcs_utils.path.walkfiles() recursive file generator\n* hcs_utils.itemstore Kind of on disk object/file/directory store\n* some smaller functionality\n* bunch of fixes\n\n1.2\n---\n\n*Release date: 2011-01-07*\n\nNo changes since 1.2rc5\n\n1.2.rc5\n-------\n\n*Release date: 2010-11-30*\n\n* unittest.eq_json, sorted output so that it can be used with dicts.\n* unittest switched place on ndiff arguments\n\n1.2.rc4\n-------\n\n*Release date: 2010-06-15*\n\n* Dropped support for Python 2.5\n* Added hcs_utils.collections.ListBuilder, a nice way to manually build lists.\n* Added hcs_utils.lock.Lock, Interprocess locking using a PID symlink.\n* Added hcs_utils.path.scan_for_new_files()\n* Added hcs_utils.path.tempdir context.\n* Added hcs_utils.storage.Storage.\\__contains__ and \\__iter__\n* Added hcs_utils.storage.json* Storage vs. json helpers\n* Added hcs_utils.threading.synchronization decorator.\n* Memoize is now thread safe.\n* hcs_utils.path.list_dir now returns a namedtuple\n\n1.1\n---\n\n*Release date: 2010-04-22*\n\n* Fixed unpickeling of Storage objects.\n\n1.0\n---\n\n*Release date: 2010-04-18*\n\n* Initial release\n",
"bugtrack_url": null,
"license": "ISC License (ISCL)",
"summary": "My personal library collecting some useful snippets.",
"version": "2.1.0",
"project_urls": {
"Homepage": "https://gitlab.com/hcs/hcs_utils",
"Repository": "https://gitlab.com/hcs/hcs_utils"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2eb6ed03f0cdac7f3b49064644d15e7221ec012c7e937819038b52ec7b88d1ae",
"md5": "b45be058bbca79a2f75fd556e6138620",
"sha256": "ab493fe39f2428c49f0799a36d4029cab8eefb5ee17121e3b51ef12dbaa5269b"
},
"downloads": -1,
"filename": "hcs_utils-2.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b45be058bbca79a2f75fd556e6138620",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.12",
"size": 23183,
"upload_time": "2024-09-03T19:09:30",
"upload_time_iso_8601": "2024-09-03T19:09:30.405783Z",
"url": "https://files.pythonhosted.org/packages/2e/b6/ed03f0cdac7f3b49064644d15e7221ec012c7e937819038b52ec7b88d1ae/hcs_utils-2.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "42c48f3769cfa11b18bceb37292adc3b1b709578bd21d92543500644560238c2",
"md5": "76531475d439ba5130bc6b7c9a0734f9",
"sha256": "6b6c4efa17722508e0204723b660d92e2732cf69332918eda448607b9c9a6bb3"
},
"downloads": -1,
"filename": "hcs_utils-2.1.0.tar.gz",
"has_sig": false,
"md5_digest": "76531475d439ba5130bc6b7c9a0734f9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.12",
"size": 17659,
"upload_time": "2024-09-03T19:09:32",
"upload_time_iso_8601": "2024-09-03T19:09:32.620584Z",
"url": "https://files.pythonhosted.org/packages/42/c4/8f3769cfa11b18bceb37292adc3b1b709578bd21d92543500644560238c2/hcs_utils-2.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-03 19:09:32",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "hcs",
"gitlab_project": "hcs_utils",
"lcname": "hcs-utils"
}