Package: tinyflux
TinyFlux is the tiny time series database optimized for your happiness :)TinyFlux is a time series version ofTinyDBthat is also written in Python and has no external dependencies.  It’s a great companion for small analytics workflows and apps, as well as at-home IOT data stores.  TinyFlux has 100% coverage, tens of thousands of downloads, and no open issues.Quick LinksExample Code SnippetsFull Example Notebooks and ScriptsDocumentationChangelogContributingInstallationTinyFlux is hosted atPyPIand is easily downloadable withpip. TinyFlux has been tested with Python 3.7 - 3.12 and PyPy-3.9 on Linux and Windows platforms.$pipinstalltinyfluxIntroductionTinyFlux is:time-centric:Python datetime objects are first-class citizens and queries are optimized for time, above all else.optimized for your happiness:TinyFlux is designed to be simple and
fun to use by providing a simple and clean API that can be learned in 5 minutes.tiny:The current source code has 4,000 lines of code (with about 50%
documentation) and 4,000 lines of tests.  TinyFlux is about 150kb, unzipped.written in pure Python:TinyFlux needs neither an external server nor any dependencies.works on Python 3.7+ and PyPy-3.9:TinyFlux works on all modern versions of Python and PyPy.100% test coverage:No explanation needed.To get started, head over to theTinyFlux docs.  Examples can be found in theexamples directory.  You can also discuss topics related to TinyFlux including general development, extensions, or showcase your TinyFlux-based projects on theGitHub discussion forum.Example Code SnippetsWriting to TinyFlux>>>fromdatetimeimportdatetime,timezone>>>fromtinyfluximportTinyFlux,Point>>>db=TinyFlux('/path/to/db.csv')>>>p=Point(...time=datetime(2022,5,1,16,0,tzinfo=timezone.utc),...tags={"room":"bedroom"},...fields={"temp":72.0}...)>>>db.insert(p,compact_key_prefixes=True)Querying TinyFlux>>>fromtinyfluximportFieldQuery,TagQuery,TimeQuery>>># Search for a tag value.>>>Tag=TagQuery()>>>db.search(Tag.room=='bedroom')[Point(time=2022-05-01T16:00:00+00:00,measurement=_default,tags=room:bedroom,fields=temp:72.0)]>>># Search for a field value.>>>Field=FieldQuery()>>>db.select("tag.room",Field.temp>60.0)["bedroom"]>>># Search for a time value.>>>Time=TimeQuery()>>>time_start=Time>=datetime(2019,1,1,tzinfo=timezone.utc)>>>time_end=Time<datetime(2023,1,1,tzinfo=timezone.utc)>>>db.count(time_start&time_end)1Full Example Notebooks and WorkflowsTheexamplesdirectory of this repository contains three common uses cases for TinyFlux and the associated boilerplate to get you started:Loading a TinyFlux DB from a CSVLocal Analytics Workflow with a TinyFlux DatabaseTinyFlux as a MQTT Datastore for IoT DevicesTinyFlux at the Edge (with Backup Strategy)TipsCheckout some tips for working with TinyFluxhere.TinyFlux Across the InternetArticles, tutorials, and other instances of TinyFlux:“Introducing TinyFlux: The Tiny Time Series Database for Python-based IoT & Analytics Applications”: A Medium.com article announcing the release of TinyFlux“Storing Time Series Data in Python Using TinyFluxDB”: A tutorial fromSteve’s Internet Guide, a portal for learning MQTT and IoT development for PythonContributingNew ideas, new developer tools, improvements, and bugfixes are always welcome.  Follow these guidelines before getting started:Make sure to readGetting Startedand theContributing Tooling and Conventionssection of the documentation.Check GitHub forexisting open issues,open a new issueorstart a new discussion.To get started on a pull request, fork the repository on GitHub, create a new branch, and make updates.Write unit tests, ensure the code is 100% covered, update documentation where necessary, and format and style the code correctly.Send a pull request.