package
stringlengths
1
122
pacakge-description
stringlengths
0
1.3M
zerodb
ZeroDBis an end-to-end encrypted database. Data can be stored on untrusted database servers without ever exposing the encryption key. Clients can execute remote queries against the encrypted data without downloading it or suffering an excessive performance hit.Special thanks to ZODB community on which ZeroDB is based.Installationpip install zerodb-serverUseful linksTechnical white paperDocumentationOpenSource Community
zerodbext.catalog
================zerodbext.catalog================A Python indexing and searching system based on `zope.index`_, fork of `repoze.catalog`_... _`zope.index`: https://pypi.python.org/pypi/zope.index.. _`repoze.catalog`: https://pypi.python.org/pypi/repoze.catalogImportant changes include dependency cleanup and Python3 support: thanks to micxjo0.8.4 (2016-03-12)==================- Forked from repoze.catalog- Python 3 support (by micxjo)- Depends on ZODB rather than ZODB3 (by micxjo)0.8.3 (2014-08-07)==================- Fix bug in query with names are None [ebrehault].- The 'numdocs' return value from 'Catalog.search' is now a subclass of integerwith an added attribute, 'total', which gives the caller access to the totalsize of the result set before being limited by the 'limit' argument.0.8.2 (2012-04-15)==================- Fix docs rendering.- Add "dev" and "docs" aliases to setup.cfg.0.8.1 (2011-08-17)==================- Harmonized index name / discriminator in catalog setup with content schemaand queries used in later examples. Thanks to Douglas Cerna.- Fixed semantics of 'applyEq' for the Keyword index. The 'applyEq' (and'applyNotEq') methods now expect scalar values for the query. 'applyAny','applyAll' and their respective negations should be used to query multiplevalues.- Fixed bug in query parser where names inside of 'any' or 'all' calls werenot being parsed properly.- When using CQEs, names may now be embedded inside of a list or tuple,allowing expressions like this: "tags in any([tag1, tag2])" where tag1 andtag2 are names that will be resolved at query run time.0.8.0 (2011-03-20)==================- Deprecated ``.search``-based querying of catalog in favor of newerquery language(s) via ``.query``. See docs for more info.- Added a ``.docids()`` method to ``CatalogIndex``.- Deprecated ``repoze.catalog.index.path2.CatalogPathIndex2``.0.7.3 (2010-08-26)==================Features--------- Refuse to pickle instances of ``zodb.broken.Broken`` which arereturned as the result of an index attempting to call a callablediscriminator function. This prevents edge cases where instanceswith out-of-sync code could too easily write Broken objects to thedatabase, leaving them around for the next hapless unpickler tofind. This is particularly a problem because many of ourdiscriminators are *functions*; the Broken machinery attempts torecover the state of a broken object when it is unpickled, but itcannot recover the state of an attempted function call.0.7.2 (2010-06-17)==================Bug Fixes---------- Fix a bug which allowed the document map to map more than one docidonto the same address, which put the reverse and forward documentmap bookeeping out of sync with each other.Packaging---------- Move benchmark directory into root of distribution instead ofleaving it in package. It interfered with normal operations of thesetuptools testrunner.- Deactivate "sortbench" console script.- Remove "Development Status" Trove classifier.- Bump version to 0.7.2.- Disuse nose.collector as test_suite (use normal setuptools test runner).- Remove (unused) TODO.txt.- Disuse ez_setup.py.- Make docs render properly in Google Chrome.Backwards Incompatibilities---------------------------- When using ``DocumentMap.add`` with a ``docid`` argument thatreferences an existing docid with metadata, that metadata is nowremoved. Previously it was retained.0.7.1 (2009-09-27)==================- Minimally get docs into shape for First PyPI release; nofunctionality changes from 0.7.0.0.7.0 (2009-08-03)==================- Fixed bug in ``DocumentMap.add`` which left orphan mappings for previousaddresses when adding an existing docid with a new address.- Added the ability to sort by text relevance. Use the name of the textindex as the ``sort_index`` in the query.0.6.2 (2009-04-15)==================- Add metadata-related APIs to ``repoze.catalog.document.DocumentMap``:``add_metadata``, ``remove_metadata``, ``get_metadata``."Metadata" is a freeform set of key/value pairs related to a docid.See the API documentation for more information.0.6.1 (2009-02-25)==================- Fixed constructor inheritance issues which kept ``repoze.catalog``from working under Python 2.6. Note that this change involved removingthe ``*args, **kw`` arguments from index constructors: those values werenever used, but had (bogus) tests.0.6.0 (2009-02-16)==================- N-Best ascending fieldindex sort was being chosen incorrectly whenthere was no limit. Symptom: ``RuntimeError, 'n-best used withoutlimit'``.0.5.9 (2009-02-16)==================- Add ``reindex_doc`` method as an alias for ``index_doc`` to bothCatalogFieldIndex and CatalogKeywordIndex (for performance,``index_doc`` for both indexes has special case code for reindexing).0.5.8 (2009-02-16)==================- Speed up path2 index attribute search by using __getitem__ ratherthan .get in some places.- Override textindex reindex_doc method: calling index_doc onlyinstead of calling unindex_doc and then index_doc is much moreefficient.0.5.7 (2009-02-14)==================- Attributes returned to attribute checker were not correct.0.5.6 (2009-02-12)==================- Add "attribute discriminator" and "attribute checker" support topath2 index. If an index is created with an attributediscriminator, when any object is indexed, the value of theattribute will be stored in the path index. The path index willknow that that attribute belongs to a particular path. Later, whenthe "attribute checker" feature of the ``apply`` or ``search``method is used, a user-supplied attribute checker function will beable to filter the result set returned by the index. This is usedby the author primarily to support security-filtered searches of apath index. It is not otherwise documented.0.5.5 (2009-02-11)==================- Add a ``reindex_doc`` method to the catalog and to the ``common``shared index base class. The catalog's ``reindex_doc`` calls eachindex's ``reindex_doc`` method when called. The common shared indexbase class implementation unindexes the docid and then subsequentlyindexes the document using the docid. This method can be overriddenfor specific indexes to do something different on a reindex.- ``repoze.catalog.indexes.path2.CatalogPathIndex2`` now takes anextra argument to its search method named ``include_path``. If thisis true, the docid set returned will include the docid for the pathspecified by the path query parameter. The ``apply`` method of theindex allows for the specification of the ``include_path`` as adictionary member in an ``apply`` call which specifies the query asa dictionary.- Give ``path2.CatalogPathIndex2`` index a better ``reindex_doc``method than the default.- The CatalogKeywordIndex's ``apply`` method mutated the query passedin if it was a dict. To fix, we override the ``apply`` method fromthe zope.index implementation.- Added a Range class importable as ``repoze.catalog.Range``. TheRange class should be used to represent a range query to aCatalogFieldIndex. The old-style of passing a 2-tuple to representa range is still supported, but will be eventually removed in favorof requring a Range object to represent a Range query. A Rangeobject can be instantiated ala "Range(start, end)".- It is now possible to pass a sequence of items to theCatalogFieldIndex ``apply`` method. When a sequence of terms thatis passed in is *not* a tuple with two items in it (the previous APIrepresenting a range, which is deprecated), it will be considered aquery for multiple terms. The docids returned for each term will beunioned together to form the result.- It is now possible to pass a dictionary to the CatalogFieldIndex``apply`` method. When a dictionary is passed, the member of thedictionary named ``query`` is treated as the query. It may be asingle term, a sequence of terms, or a Range. An additionaldictionary member named ``operator`` may also be specified: whenthis is specified, it must be one of ``or`` or ``and`` (the defaultis ``or``). If the query specifies multiple terms, and the operatoris ``or``, the results will be unioned; if the query specifiesmultiple terms and the operator is ``and``, the results will beintersected.0.5.4 (2009-02-05)==================Features--------- A newer path index implementation importable as``repoze.catalog.path2.CatalogPathIndex2`` has been added as anotherindex type. The path2 index type is an improvement inasmuch as itactually uses a graph to represent structure instead of the "levels"scheme pioneered within Zope2 (and used by``repoze.catalog.path.CatalogPathIndex``). By eye, the "levels"scheme looks like it can return the wrong results for any given pathfor a sufficiently dense tree.- Catalog indexes must now supply an ``apply_intersect`` method; itreceives a query and a set of docids (the result intersection "sofar"). It should have the same sort of return value as the``apply`` method. Indexes which inherit from``common.CatalogIndex`` will inherit a default implementation.- It is now possible to specify index query/merge order within acatalog query. See ``Index Query/Merge Order`` in the docs.0.5.3 (2009-01-05)==================Features--------- Better detection of when to use fwdscan on ascending sorts in fieldindexes.- Better detection of when to use nbest vs. timsort on ascending sortsin field indexes.0.5.2 (2009-01-04)==================Features--------- Allow a new catalog search method keyword: ``sort_type``. Forascending sorts, this can be one of ``nbest``, ``fwscan``, or``timsort``. For descending sorts, only ``nbest`` and ``timsort``are supported. This argument allows fine-grained control of whatalgorithm should be chosen to perform sorting within FieldIndexcode.- Better automatic detection of which sort algorithm to use (when it'snot supplied via ``sort_type``) based on empirical testing.- Depend on zope.index 3.5.0 rather than any earlier version(repoze.catalog fixes migrated upstream in zope.index 3.5.0).- Add 'sortbench' script to test various field index sort strategies(requires 'benchmark' extra to create charts).Bug Fixes---------- Prevent the potential for a zero division error when attempting tosort an empty set of results.0.5.1 (2008-12-31)==================Features--------- Optimize the choice of fieldindex sort strategy.- Speed up keyword index merges slightly.- Fix a bug in the return value of the catalog: it would try to returnthe minimum of the number of docs or the limit event if there was nolimit.Bug Fixes---------- Sean Upton pointed out that the document map code artificiallylimited the number of documents to half the number that it couldactually handle.0.5 (2008-11-10)================Features--------- Add path index.- Speed up keyword index 'and' (intersection) queries nominally bysorting intersected sets from smallest-to-largest first.- Benchmarking suite provided by Chris Rossi.- Add a "facet" index(``repoze.catalog.indexes.facet.CatalogFacetIndex``). This index ismuch like a keyword index, but unlike a keyword index it contains afacet list (a sequence of known colon-separated values) and acceptsvalues that are sequences of colon-separated terms. Each term issplit on its colons, forming a sequence of categories, then eachconcatenation of the categories is indexed. For example, if youindexed a document as ``['style:gucci:handbag']``, and the facetlist contained ``'style'``, ``'style:gucci'`` and``'style:gucci:handbag'``, the document would be indexed threetimes: as ``style``, as ``style:gucci`` and as``style:gucci:handbag``. Querying a facet index returns a set ofdocument ids that match the facets passed in. A facet index alsohas a ``counts`` method which provided a set of document ids,returns a dictionary containing "further constraint information" foruse in a narrowing UI. This count implementation is not meant forvery large-scale sites; it is naive.0.4 (2008-10-06)================Features--------- Speed up keyword index 'or' (union) queries by using a singleIFBTree.multiunion instead of multiple calls to IFBTree.union; thisis most helpful for speeding up 'or' queries where there are lots ofterms in the query sequence.Documentation-------------- Add ``overview`` page.0.3 (2008-10-04)================Features--------- Add ``repoze.catalog.document.DocumentMap`` class, which provides amechanism to map "addresses" (paths) to document ids.Documentation-------------- Add API documentation for catalog and document map.Backwards incompatibilities---------------------------- Rename ``searchResults`` method to ``search``.- Removed ``updateIndex`` and ``updateIndexes`` methods of catalog.- All index implementations moved into ``repoze.catalog.indexes``.- All interfaces moved to ``repoze.catalog.interfaces``.0.2 (2008-09-26)================- Provide ``sort_index`` capability.0.1 (2008-07-26)================- Initial release.
zerodb-server
UNKNOWN
zero-dce
Zero-Reference Deep Curve Estimation for Low-Light Image EnhancementYou can find more details here:https://li-chongyi.github.io/Proj_Zero-DCE.html. Have fun!The implementation of Zero-DCE is for non-commercial use only.We also provide a MindSpore version of our code:https://pan.baidu.com/s/1uyLBEBdbb1X4QVe2waog_g(passwords: of5l).PytorchPytorch implementation of Zero-DCERequirementsPython 3.7Pytorch 1.0.0opencvtorchvision 0.2.1cuda 10.0Zero-DCE does not need special configurations. Just basic environment.Or you can create a conda environment to run our code like this: conda create --name zerodce_env opencv pytorch==1.0.0 torchvision==0.2.1 cuda100 python=3.7 -c pytorchFolder structureDownload the Zero-DCE_code first. The following shows the basic folder structure.โ”œโ”€โ”€ data โ”‚ โ”œโ”€โ”€ test_data # testing data. You can make a new folder for your testing data, like LIME, MEF, and NPE. โ”‚ โ”‚ โ”œโ”€โ”€ LIME โ”‚ โ”‚ โ””โ”€โ”€ MEF โ”‚ โ”‚ โ””โ”€โ”€ NPE โ”‚ โ””โ”€โ”€ train_data โ”œโ”€โ”€ lowlight_test.py # testing code โ”œโ”€โ”€ lowlight_train.py # training code โ”œโ”€โ”€ model.py # Zero-DEC network โ”œโ”€โ”€ dataloader.py โ”œโ”€โ”€ snapshots โ”‚ โ”œโ”€โ”€ Epoch99.pth # A pre-trained snapshot (Epoch99.pth)Test:cd Zero-DCE_codepython lowlight_test.pyThe script will process the images in the sub-folders of "test_data" folder and make a new folder "result" in the "data". You can find the enhanced images in the "result" folder.Train:cd Zero-DCE_codedownload the training datagoogle driveorbaidu cloud [password: 1234]unzip and put the downloaded "train_data" folder to "data" folderpython lowlight_train.pyLicenseThe code is made available for academic research purpose only. Under Attribution-NonCommercial 4.0 International License.Bibtex@inproceedings{Zero-DCE, author = {Guo, Chunle Guo and Li, Chongyi and Guo, Jichang and Loy, Chen Change and Hou, Junhui and Kwong, Sam and Cong, Runmin}, title = {Zero-reference deep curve estimation for low-light image enhancement}, booktitle = {Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR)}, pages = {1780-1789}, month = {June}, year = {2020} }(Full paper:http://openaccess.thecvf.com/content_CVPR_2020/papers/Guo_Zero-Reference_Deep_Curve_Estimation_for_Low-Light_Image_Enhancement_CVPR_2020_paper.pdf)ContactIf you have any questions, please contact Chongyi Li [email protected] Chunle Guo [email protected] VersionThanks tuvovan ([email protected]) who re-produces our code by TF. The results of TF version look similar with our Pytorch version. But I do not have enough time to check the details.https://github.com/tuvovan/Zero_DCE_TF
zerodeg
No description available on PyPI.
zerodha-tickersaver
Zerodha WebSocket Ticker SaverFree web-socket wrapper client for Zerodha Trading platformWhatTickerSaver is a web-socket wrapper client for Zerodha trading platform which can listen to the Zerodha web-socket stream for any stock or index instruments on the Trading platform and saves the current price of the instrument in sqlite database.Any backend Live Trading Algo program can now use this live tick current price data by reading from the sql-lite database which is continuously getting updated by the TickerSaver application.It does this all free without the 2000 INR monthly cost that Zerodha charges for WebSocket live tick data.InstallHowUser needs to have a valid account on Zerodha Trading platform - KiteUser will need log into the Kite Web on any browser and copy the user token and username from the browser and provide it to the TickerSaver applicationTickerSaver will now connect to your account and connect to Zerodha WebSocket server to get live tick data for any subscribed instrumentsIt will save the current price of all subscribed instruments in a sql-lite database which can then be used by any of your applications like Live Trading bots to get the current live price from this sql-lite db which is constantly getting updatedFeaturesCosts 0 rupees to get live tick dataSaves the current price of all subscribed instruments in sql-lite database which can be used by live trading botsAt startup it can subscribe to get and save the current price of all instruments showing up in the current positions in Zerodha account based on configsubscribe_current_positions.Can dynamically subscribe to new instruments when the application is already running by adding the Zerodha instrument_id , tradingsymbol in theconf/ticker_instruments.csvfile For example:12628226,BANKNIFTY22N0339500PEWhen new positions are taken in Zerodha account after application startup and if they need to be subscribed to dynamically then just create a filetouch instrument_touch.txtwhich will load all current positions from Zerodha account and subscribe to them and start saving the current price .UsageInstallationInstall the packagepip install zerodha_tickersaverORDownload the sourcegit clone https://github.com/simonmh2u/TickerSaver.gitConfig fileTakes as an input a json config filedbpath : absolute path of the sqlite file where it needs to be createdtickerfile_path: absolute path of the csv file which stores the instrument file that are subscribed by the applicationsubscribe_current_positions : If true reads the current positions in the users zerodha account and subscribes to those instruments to get the current pricedefault_instruments: list of zerodha instruments that will get subscribed to by default even if not present in the tickerfile csvzusername: userid copied from browserzwsstoken: token copied from the browser{ "dbpath": "/Users/johnwick/ticker_instruments.csv/live_price.db", "tickerfile_path": "/Users/johnwick/ticker_instruments.csv", "subscribe_current_positions": true, "default_instruments": [ 256265, 264969, 260105 ], "zusername":"", "zwsstoken":"" }Startup StepsUser needs to manually login into Kite on any browser , and copy the below token and user from the Cookie section of the developer console.Needs to set the username and token as environment variables "ZUSERNAME" and "ZWSSTOKEN" respectivelyNeeds to add "zusername" and "zwsstoken" configs in the user supplied config file path(this overrides the above env variables){ "zusername":"YL1111", "zwsstoken":"XXXXXXX" }Fire up the applicationtickersaver -c config.json(when package installed)python tickersaver/fetcher/kite/ws_tick_fetcher.py -c config.json(when source downloaded)DisclaimerTickerSaver is an application built for self learning and as a Jugaad(definition: a resourceful approach to problem-solving)to understand the working of web-sockets and to see if the live tick data from zerodha can be extracted and saved locally tick by tick for free without paying for monthly charges for API access. Please use at your own discretion.
zerodha-without-api
use zerodha without api
zero-divisor-graph
Zero Divisor Graph math libraryThis is a pure python library for working with zero divisor graphs of commutative semigroups. The primary purpose is to automate the task of checking if a given graph is a zero divisor graph and for what possible semigroups.Installationpip3 install zero-divisor-graphYou can also retrieve from source athttps://github.com/Paulcappaert/zero-divisor-graphusefirst start python3 in a terminal window and import the ZeroDivisorGraph objectpython3 >>> from zdg.zdg import ZeroDivisorGraph as ZDGYou can create a zero divisor graph from edges as such. the vertices can be named whatever you want.>>> example1 = ZDG((1, 2), (2, 3)) >>> example2 = ZDG(('a', 'b'), ('b', 'c'))You can print all of the semigroups from a zero divisor graph as such>>> semigroups = example1.semigroups() >>> for s in semigroups: ... print(s.caley_table())
zerodoc
Version 0.2.3 Last updated [email protected] is a โ€œplain text formatโ€ in the spirit ofasciidoc,POD,reStructuredTextormarkdown, with an emphasis on simplicity and extensibility. Very few formatting options are avaliable, both to keep the parser simple and to make it easy to write new generators for the whole format.Included are a Python library can be used to translate an input file or buffer into a tree that for wich generators can be easily written, and a command line tool to call existing generators for HTML, reStructuredText (that can then be converted or integrated with other tools like Sphinx) and a JSON intermediate representation.1. The zerodoc format1.1 Paragraphs and linesZerodoc files are simple text files organized in paragraphs. A paragraph is a group of text lines separated from other paragraphs by blank lines. Lists and source code copiedverbatimcan be defined. An unintrusive format for links is used, based on a references system.Lines are limited to 72 characters for regular (not code or diagrams) text. If you need to put something more into a line (for example, a long URL), divide it in two and put a backslash () with no spaces at the end.Example:This is a very long url that needs to be splitted in three: http://www.reallyreallyreallylonguniformresourcelocatorredir\ ection.com/redirectionator.php?theredirectioncode=d72a565ab8\ 7dedf7b5fa84b3ec4b9f11Renders into:This is a very long url that needs to be splitted in three:http://www.reallyreallyreallylonguniformresourcelocatorredirection.com/redirectionator.php?theredirectioncode=d72a565ab87dedf7b5fa84b3ec4b9f111.2 ListsLists are defined as paragrahps prefixed with a dash, and can be nested. Example- The first element in a list - A nested element into the first consisting of two lines that are joined on output - Another nested element - The third element in a listRenders into:The first element in a listA nested element into the first consisting of two lines that are joined on outputAnother nested elementThe third element in a listBackslash joining also occur inside list elements:- The first element in a list. as it have two lines with no backslash, an space is inserted between 'lines' and 'with' - To join the two lines without adding a space a back\ slash is used. Note that the two spaces formatting the listline are removedrenders into:The first element in a list. as it have two lines with no backslash, an space is inserted between โ€˜linesโ€™ and โ€˜withโ€™To join the two lines without adding a space a backslash is used. Note that the two spaces formatting the listline are removed after the backslashNOTE: There are no numbered lists. In the โ€œphylosophyโ€ of zerodoc, numbers can not be omited from the original text nor โ€˜computedโ€™ because that will make the text less readable than itโ€™s processed output.1.3 Formatting attributesSome attributes for the text inherited from other common formats and email conventions are supported:- This is an *emphasis* - This is an _underline_ (cursive on certain displays or formats, as in manual pages) - This is a 'cursive'Renders into:This is anemphasisThis is an _underline_ (cursive on certain displays or formats, as in manual pages)This is a โ€˜cursiveโ€™1.4 LinksLinks can be included directly in the text along with their destination, or referenced first in the text and then โ€˜resolvedโ€™ in another line.Source of a link:This `link`:http://www.google.com will redirect to googleWill render as:Thislinkwill redirect to googleReferenced links are โ€˜resolvedโ€™ in lists of links. This lists of links will be removed from output directly. If the list is contained in a section alone, the section is also removed from output. See the โ€˜Referencesโ€™ section at the end of the source code of this document for an example. An โ€˜autocontainedโ€™ example could be:This line contains two referenced links: `firstlink` and `secondlink` - `firstlink`:http://www.google.com - `secondlink`:http://www.google.comWich renders into:This line contains two referenced links:firstlinkandsecondlink1.5 Source codeSource code is text that will be included verbatim in the output. In source code, newlines are meaningful and no limits on line-length are imposed. An example:#include <stdio.h> int main() { // print hello world 100 times for (int i = 0; i < 100; i++) { printf("Hello, world!\n"); } }Source code is identified by one space before the content of the first line and one or more spaces in the rest. No tabs can be used, so either transform tabs-only source code before pasting or use a tool like expand(1) to do it for you. Blank lines are also included verbatim, up to the one delimiting the next โ€˜regularโ€™ paragraph (one that contains text and starts on the first column)To illustrate source code, i am going to paste the source code (yo dawg) of the example above, along with the regular paragraph-lines sorrounding it:source code, newlines are meaningful and no limits on line-length are imposed. An example: #include <stdio.h> int main() { // print hello world 100 times for (int i = 0; i < 100; i++) { printf("Hello, world!\n"); } } Source code is identified by one space before the content of the first line and one or more spaces in the rest. No tabs can When pygmentize is used, the default language for syntax highlighting can be specified in options.1.6 Diagrams and imagesDiagrams can be either included directly in the output, just as source code, or optionally converted to images (when this is possible, for example in a manual page it does not make sense to include images). Diagrams are converted using ditaa, aafigure, ascii2svg or tikz depending on the options parsed to the renderer. Refer to theaafigure manual pageor to theditaa websitefor help on this formats.Diagrams are recognized by using TWO or more spaces before the first line of them. Anything up to the next โ€˜regularโ€™ paragraph is considered part of the diagram.Source-code paragraphs and diagrams can not be adjacent; they need a โ€˜regularโ€™ text paragraph (starting on the first column) between them. This makes sense since no diagram can follow source code or viceversa without at least an introduction of what the reader is seeing.1.6.1 ASCIIToSVG ascii-art diagramsThe default for ascii art diagrams isasciitosvg. As it name implies, it converts text to SVG wich is quite convenient. It is written in php. Example diagram: (asciitosvg)1.6.2 aafigure ascii-art diagramsAnother format to convert ascii art diagrams to graphics is aafigure. it is written in Python and have quite convenient idioms for things like sequence diagrams:1.6.3 ditaa ascii-art diagramsAnother common format for ascii art diagrams is ditaa. It does not support svg output.This is the source code of the following paragraph (diagram taken from the `ditaa website`: Example diagram: (ditaa) +--------+ +-------+ +-------+ | | --+ ditaa +--> | | | Text | +-------+ |diagram| |Document| |!magic!| | | | {d}| | | | | +---+----+ +-------+ +-------+ : ^ | Lots of work | +-------------------------+This is the source code of the following paragraph (diagram taken from theditaa websiteNote that there are two spaces before the first +โ€”1.6.4 TikZ diagramsA Tikz diagram (from the Tikz examples)LaTeX source code for that Tikz chunk:\begin{tikzpicture}[auto,node distance=3cm, thick,main node/.style={circle,fill=blue!20,draw, font=\sffamily\Large\bfseries}] \node[main node] (1) {1}; \node[main node] (2) [below left of=1] {2}; \node[main node] (3) [below right of=2] {3}; \node[main node] (4) [below right of=1] {4}; \path[every node/.style={font=\sffamily\small}] (1) edge node [left] {0.6} (4) edge [bend right] node[left] {0.3} (2) edge [loop above] node {0.1} (1) (2) edge node [right] {0.4} (1) edge node {0.3} (4) edge [loop left] node {0.4} (2) edge [bend right] node[left] {0.1} (3) (3) edge node [right] {0.8} (2) edge [bend right] node[right] {0.2} (4) (4) edge node [left] {0.2} (3) edge [loop right] node {0.6} (4) edge [bend right] node[right] {0.2} (1); \end{tikzpicture}1.6.6 Diagram tagging and autodetectionAs with source code, the type of diagram is autodetected for Tikz and gnuplot diagrams. This detection can be overriden by specifing it in the first line of the diagram, between parenthesis.1.7 Definition listsA definition list is a list of terms and corresponding definitions. It usually renders (in HTML, man pages, ReST) in the text of the definition indented with respect to the title. It is useful for documenting functions and command line parameters.Following is an example:man ls Display the manual page for the item (program) ls. man -a intro Display, in succession, all of the available intro manual pages contained within the manual. It is possible to quit between successive displays or skip any of them.that renders into:man lsDisplay the manual page for the item (program) ls.man -a introDisplay, in succession, all of the available intro manual pages contained within the manual. It is possible to quit between successive displays or skip any of them.1.8 The default zerodoc structure1.8.1 HeaderThe header in a zerodoc document contains the title, an optional abstract and a table of contents. The table of contents needs to be updated by hand (this is different from other well known text formats but allow zerodoc to have free-form titles (no โ€” nor ~~~ nor any other form of markup is needed):This is the title, that can spawn several lines This are one or several paragraphs of abstract 1. Title 1 2. Title 21.8.1.1 TitleThe title can spawn several lines (a whole paragraph) that will be joined together on outputThe table of contents can be prefixed by a โ€˜Table of conentsโ€™ line that will be recognized automatically as the TOC title. If that line is not present, it will also be ommited on the transformed output.1.8.1.2 AbstractThe abstract is a group of paragraphs that appear before the Table of content.1.8.1.3 Table of contentsThe table of contents is a list of the titles of the different sections, for example- 1. Section one - 2. Section two - 3. Third sectionWill define the table of contents of a document, if found in the header (after the abstract). If a title listed here is not found in the document, an error is yielded.1.8.2 BodyThe body is formed by several paragraphs. Paragraphs are divided into sections by lines with titles. The lines with titles should appear in the TOC and should have the same content as the TOC. Optionally they can be in uppercase for clarity. As the transformed document usually will have better ways to emphasize the title, the lowercase format used in the TOC will be used regardless of uppercase being used. For example, the next section of this document starts with2. INSTALLING ZERODOC 2.1 PrerrequisitesAnd in the TOC the pertinent lines appear as:-- toc fragment -- - 1.7.1.3 Table of contents - 1.7.2 Body - 2. Installing zerodoc - 2.1 PrerrequisitesAs you can see on the start of the next section, the title appears in lowercase (as in the TOC above)2. Installing zerodoc2.1 PrerrequisitesZerodoc needs Python (2.6 or newer) the Python PLY โ€˜lex and yaccโ€™ utilities (2.5 or newer) and distutils for installation. Aditionally when generating diagrams, the programs to parse them need to be installed as well.As an example, in a GNU/Linux Debian 6.0 โ€˜Squeezeโ€™ system, the requirements can be installed using:# apt-get install python-ply python-aafigure ditaaTo generate diagrams with gnuplot or tikz, install the pertinent packages# apt-get install gnuplot # apt-get install texlive-picture2.2 Installing the library and interpreter2.2.1 Using a git snapshotClone the github repository using$ git clone git://github.com/odkq/zerodoc.gitChange to the zerodoc dir and call setup.py as root$ cd zerodoc/ $ sudo ./setup.py install2.2.2 Using pypi3. Using the command line converterzerodoc - converts a zerodoc text file to HTML and many other formats3.1 SYNOPSISUsage: zerodoc [options]Options:-h, โ€“help show this help message and exit-f FORMAT, โ€“format=FORMAT Output format. If ommited, โ€˜htmlโ€™-o OPTIONS, โ€“options=OPTIONS Options for format renderer-i FILE, โ€“input=FILE Use <filename> as input file. If ommited, use stdin.-O FILE, โ€“output=FILE Use <filename> as output file. If ommited,use stdout.3.2 HTML output optionsditaaUse ditaa to format diagrams. When this option is used, you can specify the path of the ditaa .jar file with jarpath:<path>. If jarpath is ommited, โ€˜dittaโ€™ will be called (you can install a command-line ditta wraper in Debian and others with apt-get install ditaa)jarpath:<path>Location of the .jar path (there is no default, โ€˜javaโ€™ must be in the $PATH)aafigureUse aafigure to format diagramssvgPrefer svg in output when applicable (when the converter outputs it and when the rendered format allows for scalable graphics)datauriDo not generate image files, embbed the images directly in the HTML usingDataURIscheme3.3 reStructuredText output optionsnotocUsuallyreStructuredTextprocessors attach their own index in the side (sphinx-doc, for example). In that case, you better do not output the toc (it is still used to get section titles)3.4 JSON output optionsJson output has no options. Itโ€™s output is the json render of the parsed tree with no interpretation whatsoever3.5 Confluence output optionsditaa, jarpath, aafigure, datauriWith the same meaning as in the HTML output optionsYou can specify an output file, and paste it by hand into the confluence โ€˜editionโ€™ formulary, or you can make zerodoc client upload it directly with this options:folder:<folder>Folder (path) for the uploaded documentuser:<user>User to usepasswd:<passd>Passwordhost:<host>Host
zerodose
ZerodoseA tool to assist in personalized abnormality investigation in combined FDG-PET/MRI imaging. Created by the department ofClinically Applied Artificial IntelligenceatCopenhagen University HospitalInstallationNote that a python3 installation is required forZerodoseto work. You can installZerodoseviapipfromPyPI:$pipinstallzerodoseUsageSynthesize baseline PET$zerodosesyn-imr.nii.gz-mbrain_mask.nii.gz-osb_pet.nii.gzCreate abnormality map$zerodoseabn-ppet.nii.gz-ssb_pet.nii.gz-mbrain_mask.nii.gz-oabn.nii.gzPlease see theCommand-line Referencefor details.Hardware requirementsTODOIssues and contributingContributions are very welcome. If you encounter any problems, pleasefile an issuealong with a description.
zero-downtime-migrations
Zero-Downtime-MigrationsDescriptionZero-Downtime-Migrations (ZDM)โ€“ this is application which allow you to avoid long locks (and rewriting the whole table) while applying Django migrations using PostgreSql as database.Current possibilitiesadd field with default value (nullable or not)create index concurrently (and check index status after creation in case it was created with INVALID status)add unique property to existing field through creating unique index concurrently and creating constraint using this indexWhy use itWe face such a problem - performing some django migrations (such as add column with default value) lock the table on read/write, so its impossible for our services to work properly during this periods. It can be acceptable on rather small tables (less than million rows), but even on them it can be painful if service is high loaded. But we have a lot of tables with more than 50 millions rows, and applying migrations on such a table lock it for more than an hour, which is totally unacceptable. Also, during this time consuming operations, migration rather often fail because of different errors (such as TimeoutError) and we have to start it from scratch or run sql manually thought psql and when fake migration.So in the end we have an idea of writing this package so it can prevent long locks on table and also provide more stable migration process which can be continued if operation fall for some reason.InstallationTo installZDM, simply run:pipinstallzero-downtime-migrationsUsageIf you are currently using default postresql backend change it to:DATABASES={'default':{'ENGINE':'zero_downtime_migrations.backend',...}...}If you are using your own custom backend you can:SetSchemaEditorClassif you are currently using default one:fromzero_downtime_migrations.backend.schemaimportDatabaseSchemaEditorclassDatabaseWrapper(BaseWrapper):SchemaEditorClass=DatabaseSchemaEditorAddZeroDownTimeMixinto base classes of yourDatabaseSchemaEditorif you are using custom one:fromzero_downtime_migrations.backend.schemaimportZeroDownTimeMixinclassYourCustomSchemaEditor(ZeroDownTimeMixin,...):...Note about indexesLibrary will always force CONCURRENTLY index creation and after that check index status - if index was created with INVALID status it will be deleted and error will be raised. In this case you should fix problem if needed and restart migration. For example if creating unique index was failed you should make sure that there are only unique values in column on which index is creating. Usually index creating with invalid status due to deadlock so you need just restart migration.ExampleWhen adding not null column with default django will perform such sql query:ALTERTABLE"test"ADDCOLUMN"field"booleanDEFAULTTrueNOTNULL;Which cause postgres to rewrite the whole table and when swap it with existing one (note from django documentation) and during this period it will hold exclusive lock on write/read on this table.This package will break sql above in separate commands not only to prevent the rewriting of whole table but also to add column with as small lock times as possible.First of all we will add nullable column without default and add default value to it in separate command in one transaction:ALTERTABLE"test"ADDCOLUMN"field"booleanNULL;ALTERTABLE"test"ALTERCOLUMN"field"SETDEFAULTtrue;This will add default for all new rows in table but all existing ones will be with null value in this column for now, this operation will be quick because postgres doesnโ€™t have to fill all existing rows with default.Next we will count objects in table and if result if more than zero - calculate the size of batch in witch we will update existing rows. After that while where are still objects with null in this column - we will update them.While result of following statement is more than zero:WITHcteAS(SELECT<table_pk_column>aspkFROM"test"WHERE"field"isnullLIMIT<size_calculated_on_previous_step>)UPDATE"test"table_SET"field"=trueFROMcteWHEREtable_.<table_pk_column>=cte.pkWhen we have no more rows with null in this column we can set not null and drop default (which is django default behavior):ALTERTABLE"test"ALTERCOLUMN"field"SETNOTNULL;ALTERTABLE"test"ALTERCOLUMN"field"DROPDEFAULT;So we finish add field process. It will be definitely more time consuming than basic variant with one sql statement, but in this approach there are no long locks on table so service can work normally during this migrations process.Run tests./run_tests.sh
zeroe
No description available on PyPI.
zeroed
RequirementsTo work correctly, you will first need:python(v3.8 or recent) must be installed.pip(v20.0 or recent) must be installed.InstallingGlobally:$sudopipinstallzeroedFor the user:$pipinstallzeroed--userUsingAccess the official page of the project where you can find a description of use:The gem is available as open source under the terms of theMIT LicenseยฉCreditsSee,AUTHORS.LinksCode:https://github.com/snakypy/zeroedDocumentation:https://github.com/snakypy/zeroed/blob/master/README.mdReleases:https://pypi.org/project/zeroed/#historyIssue tracker:https://github.com/snakypy/zeroed/issues
zeroeventhub
ZeroEventHubThis README file contains information specific to the Python port of the ZeroEventHub. Please see themain readme filefor an overview of what this project is about.ClientWe recommend that you store the latest checkpoint/cursor for each partition in the client's database. Example of simple single-partition consumption.Note about the example:Things starting with "my" is supplied by youThings starting with "their" is supplied by the service you connect to>>>importzeroeventhub>>>importhttpx>>>importasyncio>>>fromtypingimportSequence>>>fromunittest.mockimportMagicMock,Mock,PropertyMock>>>my_db=MagicMock()>>>my_person_event_repository=Mock()>>>my_person_event_repository.read_cursors_from_db.return_value=None# Step 1: Setup>>>their_partition_count=1# documented contract with server>>>their_service_url="https://localhost:8192/person/feed/v1">>>my_zeh_session=httpx.AsyncClient()# you can setup the authentication on the session>>>client=zeroeventhub.Client(their_service_url,their_partition_count,my_zeh_session)# Step 2: Load the cursors from last time we ran>>>cursors=my_person_event_repository.read_cursors_from_db()>>>ifnotcursors:...# we have never run before, so we can get all events with FIRST_CURSOR...# (if we just want to receive new events from now, we would use LAST_CURSOR)...cursors=[...zeroeventhub.Cursor(partition_id,zeroeventhub.FIRST_CURSOR)...forpartition_idinrange(their_partition_count)...]# Step 3: Enter listening loop...>>>my_still_want_to_read_events=PropertyMock(side_effect=[True,False])>>>asyncdefpoll_for_events(cursors:Sequence[zeroeventhub.Cursor])->None:...page_of_events=zeroeventhub.PageEventReceiver()...whilemy_still_want_to_read_events():...# Step 4: Use ZeroEventHub client to fetch the next page of events....awaitzeroeventhub.receive_events(page_of_events,...client.fetch_events(cursors),...)......# Step 5: Write the effect of changes to our own database and the updated...# cursor value in the same transaction....withmy_db.begin_transaction()astx:...my_person_event_repository.write_effect_of_events_to_db(tx,page_of_events.events)...my_person_event_repository.write_cursors_to_db(tx,page_of_events.latest_checkpoints)...tx.commit()......cursors=page_of_events.latest_checkpoints...page_of_events.clear()>>>asyncio.run(poll_for_events(cursors))ServerThis library makes it easy to setup a zeroeventhub feed endpoint with FastAPI.>>>fromtypingimportAnnotated,Any,AsyncGenerator,Dict,Optional,Sequence>>>fromfastapiimportDepends,FastAPI,Request>>>fromfastapi.responsesimportStreamingResponse>>>fromzeroeventhubimport(...Cursor,...DataReader,...ZeroEventHubFastApiHandler,...)>>>fromunittest.mockimportMock>>>app=FastAPI()>>>PersonEventRepository=Mock>>>classPersonDataReader(DataReader):...def__init__(self,person_event_repository:PersonEventRepository)->None:...self._person_event_repository=person_event_repository......defget_data(...self,cursors:Sequence[Cursor],headers:Optional[Sequence[str]],page_size:Optional[int]...)->AsyncGenerator[Dict[str,Any],Any]:...return(...self._person_event_repository.get_events_since(cursors[0].cursor)....take(page_size)....with_headers(headers)...)>>>defget_person_data_reader()->PersonDataReader:...returnPersonDataReader(PersonEventRepository())>>>PersonDataReaderDependency=Annotated[...PersonDataReader,...Depends(get_person_data_reader,use_cache=True),...]>>>@app.get("person/feed/v1")...asyncdeffeed(request:Request,person_data_reader:PersonDataReaderDependency)->StreamingResponse:...api_handler=ZeroEventHubFastApiHandler(data_reader=person_data_reader,server_partition_count=1)...returnapi_handler.handle(request)DevelopmentTo run the test suite, assuming you already have Python 3.10 or later installed and on yourPATH:pipinstallpoetry==1.5.1 poetryconfigvirtualenvs.in-projecttruepoetryinstall--sync poetryruncoveragerun--branch-mpytest poetryruncoveragehtmlThen, you can open thehtmlcov/index.htmlfile in your browser to look at the code coverage report.Also, to pass the CI checks, you may want to run the following before pushing your changes:poetryrunblacktests/zeroeventhub/ poetryrunpylint./zeroeventhub/ poetryrunflake8 poetryrunmypy
zero-example
Example PackageThis is a simple example package. You can useGithub-flavored Markdownto write your content.
zeroframe-ws-client
ZeroFramePyZeroFrame WebSocket API for Python.DescriptionThis is Python WebSocket client forZeroFrame API. It supports (almost) same features as default ZeroFrame that is included in ZeroNet sites, but it is using WebSocket client so it can be used in local programs.InstallationRequirementsContentHash requires Python 3.5 or higher.From PyPIThe recommended way to install ContentHash is from PyPI with PIP.pipinstallzeroframe-ws-clientFrom SourceAlternatively, you can also install it from the source.gitclonehttps://github.com/filips123/ZeroFramePy.gitcdZeroFramePy pythonsetup.pyinstallUsageImporting PackageYou can import ZeroFrameJS fromzeroframe_ws_clientpackage.fromzeroframe_ws_clientimportZeroFrameCreating ConnectionTo create a connection, you need to specify the ZeroNet site address.zeroframe=ZeroFrame('1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D')If ZeroNet instance is usingMultiuserplugin and you want to use specific account, you need to specify a master address of the account you want to use. Account must already exist on the instance.zeroframe=ZeroFrame('1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D',multiuser_master_address='1Hxki73XprDRedUdA3Remm3kBX5FZxhFR3')If you want to create a new account, you also need to specify a master seed of it. Note that this feature is unsafe on the untrusted proxy.zeroframe=ZeroFrame('1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D',multiuser_master_address='1KAtuzxwbD1QuMHMuXWcUdoo5ppc5wnot9',multiuser_master_seed='fdbaf75427ba69a3d4aa8e19372e05879e9e2d866e579dd30be25e6fab7e3fb2')If needed, you can also specify protocol, host and port of ZeroNet instance.zeroframe=ZeroFrame('1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D',instance_host='192.168.1.1',instance_port=8080,instance_secure=True)Log and error message fromzeroframe.logandzeroframe.errorwill not be displayed by default. If you want to, you can also display them as debug info.zeroframe=ZeroFrame('1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D',show_log=True,show_error=True)By default, the client will try to reconnect WebSocket if the connection was closed every 5 seconds. You can also configure time delay and total attempts. Delay is specified in milliseconds. The number of attempts-1means infinity and0means zero (disabled reconnecting).zeroframe=ZeroFrame('1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D',reconnect_attempts=10,reconnect_delay=1000)The client will then obtain wrapper key to the site and connect to WebSocket using it.You can now normally use ZeroFrame API. Just remember that there is no wrapper, so wrapper commands are not available. The client is connected directly to the WebSocket server, so you need to use its commands.Note that the WebSocket server sometimes sends commands (notification,progress,error,prompt,confirm,setSiteInfo,setAnnouncerInfo,updating,redirect,injectHtml,injectScript) that are normally handled by the wrapper. Because there is no wrapper, you need to handle those commands yourself if needed. Commandsresponseandpingare already handled by this client so you don't need to handle them.Sending CommandYou can use thecmdmethod to issue commands.zeroframe.cmd('siteInfo',{},lambdaresult:print(result))You can also use thecmdpmethod to get results as Python asyncio futures.result=zeroframe.cmd('siteInfo',{})print(result.result())Sending ResponseTo submit responses, you need to useresponsecommand.zeroframe.response(10,'Hello World')Logging InformationThere are alsologanderrormethods which are available for logging. They will display output to console if enabled.zeroframe.log('Connected')zeroframe.error('Connection failed')Handling ConnectionThere are also public handler methods which you can overwrite to add your own logic to ZeroFrame.classZeroApp(ZeroFrame):defon_request(self,cmd,message):ifcmd=='helloWorld':self.log('Hello World')defon_open_websocket(self):self.log('Connected to WebSocket')defon_error_websocket(self,error):self.error('WebSocket connection error')defon_close_websocket(self):self.error('WebSocket connection closed')Closing ConnectionYou can useclosemethod to close WebSocket connection to ZeroFrame API.zeroframe.close()Calling Commands DirectlyYou can also directly call commands via__getattr__method. Command name is accepted as an object's property and parameters are accepted as a method's arguments. Command returnsasyncio.Futurewith the result.Command with no arguments can be accessed withzeroframe.cmdName().Command with keyword arguments can be accessed withzeroframe.cmdName(key1=value1, key2=value2).Command with normal arguments can be accessed withzeroframe.cmdName(value1, value2).siteInfo=zeroframe.siteInfo()print(siteInfo.result())Other ExamplesYou could also look toexample.py.VersioningThis library usesSemVerfor versioning. For the versions available, seethe tagson this repository.LicenseThis library is licensed under the MIT license. See theLICENSEfile for details.
zerofs
Transparant filesystem backed by Backblaze B2 object store.
zerofun
๐Ÿ™… ZerofunRemote function calls for array data usingZMQ.OverviewZerofun provides aServerthat you can bind functions to and aClientthat can call the messages and receive their results. The function inputs and results are both flatdicts of Numpy arrays. The data is sent efficiently without serialization to maximize throughput.InstallationpipinstallzerofunExampleThis example runs the server and client in the same Python program using subprocesses, but they could also be separate Python scripts running on different machines.defserver():importzerofunserver=zerofun.Server('tcp://*:2222')server.bind('add',lambdadata:{'result':data['foo']+data['bar']})server.bind('msg',lambdadata:print('Message from client:',data['msg']))server.run()defclient():importzerofunclient=zerofun.Client('tcp://localhost:2222')client.connect()future=client.add({'foo':1,'bar':1})result=future.result()print(result)# {'result': 2}client.msg({'msg':'Hello World'})if__name__=='__main__':importzerofunserver_proc=zerofun.Process(server,start=True)client_proc=zerofun.Process(client,start=True)client_proc.join()server_proc.terminate()FeaturesSeveral productivity and performance features are available:Request batching:The server can batch requests together so that the user function receives a dict of stacked arrays and the function result will be split and sent back to the corresponding clients.Multithreading:Servers can use a thread pool to process multiple requests in parallel. Optionally, each function can also request its own thread pool to allow functions to block (e.g. for rate limiting) without blocking other functions.Async clients:Clients can send multiple overlapping requests and wait on the results when needed usingFutureobjects. The maximum number of inflight requests can be limited to avoid requests building up when the server is slower than the client.Error handling:Exceptions raised in server functions are reported to the client and raised infuture.result()or, if the user did not store the future object, on the next request. Worker exception can also be reraised in the server application usingserver.check().Heartbeating:Clients can send ping requests when they have not received a result from the server for a while, allowing to wait for results that take a long time to compute without assuming connection loss.Concurrency:ThreadandProcessimplementations with exception forwarding that can be forcefully terminated by the parent, which Python threads do not natively support. Stoppable threads and processes are also available for coorperative shutdown.GIL load reduction:TheProcServerbehaves just like the normalServerbut uses a background process to batch requests and fan out results, substantially reducing GIL load for the server workers in the main process.QuestionsPlease open aGitHub issuefor each question. Over time, we will add common questions to the README.
zero-g
soon
zerogpu
Hugging Face ZeroGPU Spaces
zerogram
Telegram MTProto API Framework for PythonDocumentationโ€ขReleasesโ€ขNewsPyrogramElegant, modern and asynchronous Telegram MTProto API framework in Python for users and botsfrompyrogramimportClient,filtersapp=Client("my_account")@app.on_message(filters.private)asyncdefhello(client,message):awaitmessage.reply("Hello from Pyrogram!")app.run()Pyrogramis a modern, elegant and asynchronousMTProto APIframework. It enables you to easily interact with the main Telegram API through a user account (custom client) or a bot identity (bot API alternative) using Python.SupportIf you'd like to support Pyrogram, you can consider:Become a GitHub sponsor.Become a LiberaPay patron.Become an OpenCollective backer.Key FeaturesReady: Install Pyrogram with pip and start building your applications right away.Easy: Makes the Telegram API simple and intuitive, while still allowing advanced usages.Elegant: Low-level details are abstracted and re-presented in a more convenient way.Fast: Boosted up byTgCrypto, a high-performance cryptography library written in C.Type-hinted: Types and methods are all type-hinted, enabling excellent editor support.Async: Fully asynchronous (also usable synchronously if wanted, for convenience).Powerful: Full access to Telegram's API to execute any official client action and more.Installingpip3installpyrogramResourcesCheck out the docs athttps://docs.pyrogram.orgto learn more about Pyrogram, get started right away and discover more in-depth material for building your client applications.Join the official channel athttps://t.me/pyrogramand stay tuned for news, updates and announcements.
zerogravity
my zero g prj
zerogroup
Package DescriptionZeroGroup is a simple wrapper class for managing multiple ZeroMQ sockets and streams.InstallationThe package may be installed as follows:pip install zerogroupUsage ExamplesSee theexamplesdirectory for demos of how to use the class.DevelopmentThe latest release of the package may be obtained fromGitHub.AuthorSee the included AUTHORS.rst file for more information.LicenseThis software is licensed under theBSD License. See the included LICENSE.rst file for more information.
zeroguard
ZeroGuard Python OSS ToolsComing soon
zeroguard-cli
ZeroGuard CLINOTE: This project is currently under active development. Nothing works as of right now but that may change any day. Start, watch and check it out later.This is an official CLI application for interacting withZeroGuard Reconthreat intelligence platform.
zeroguard-sdk
ZeroGuard Python SDKComing soon
zerohash-python
No description available on PyPI.
zerohero
Zero Hero: A Simple Zero-Shot ClassifierZero Hero is a simple zero-shot classifier that is easy to use and works well for a variety of tasks. It is especially useful for classifying text that is unlabeled, and can even be applied to pseudo-label data.What is a zero-shot classifier?A zero-shot text classifier is a machine learning model capable of classifying new data into categories or classes not seen during model training. Because these pre-trained models have been trained on such a large corpus of text, the model is able to infer the meaning of novel words and phrases and apply this knowledge to classify new text.Why use Zero Hero?There are several reasons why youโ€™d want to use Zero Hero:Itโ€™s easy to use. You only need to create a list of the categories you want to classify text for, and then pass this list to the classifier.Itโ€™s accurate. Zero Hero has been shown to be accurate on a variety of tasks.Itโ€™s fast. Zero Hero is very efficient and can classify text quickly.InstallationTo use Zero Hero, you first need to install the package using pip:pip install zeroheroHow to use Zero Hero with SentenceTransformers (Easy)To use SentenceTransformers,model_typemust be passed as "sentence-transformers" andmodel_namesupports any ofthesemodels.For examples:fromzeroheroimportmake_zero_shot_classifier# Create a classifier and pass the categories you wish to classifycategories=['sports','politics','business','entertainment','science']classifier=make_zero_shot_classifier(categories=categories,model_type="sentence-transformers",model_name="paraphrase-albert-small-v2",)Note that the categories passed to the classifier need to be semantically meaningful, i.e. categories of 1,2,3,4 would not be appropriate. Once you have created a classifier, you can use it to classify text using the following code:# Classify a piece of texttext='The president gave a speech today about the economy.'result=classifier(text)# Print the categoryresult["category"]This will print the following output:businessThis output indicates the classifier is most confident that the text pertains to business.Using Zero Hero with OpenAI embedding modelsIn order to use and OpenAI model, you'll need an OpenAI API key.Passmodel_typeas "open_ai" andopenai_api_keyas your OpenAI API key.model_namecan be any of:"text-embedding-3-small", "text-embedding-3-large", "text-embedding-ada-002"and should support other OpenAI embedding models as they are released.Hereis a list of current embedding models as OpenAI releases them.Here is an example:openai_api_key="sk-..."categories=["cat","dog","mouse","human"]zsc=make_zero_shot_classifier(categories=categories,model_type="openai",model_name=model_name,openai_api_key=openai_api_key,)result=zsc(cat_text)print(result)Why use Zero Hero instead of a prompt-based classifier?There are several reasons why you might want to use Zero Hero instead of a prompt-based classifier:Zero Hero is cheaper. A prompt-based classifier can be very expensive to use, especially if you have a lot of text to classify.Zero Hero is more accurate. Prompt-based classifiers can be less accurate than zero-shot classifiers, especially on tasks that require a deep understanding of the text.Zero Hero is easier to use. Prompt-based classifiers can be more difficult to use than zero-shot classifiers, especially if you are not familiar with machine learning.The zero-shot classifier offers a cost-effective and efficient alternative to prompt-based classifiers for text categorization tasks. It can effectively classify text into predefined categories without the need for extensive training data by employing text embeddings and cosine similarity..Text embeddings are created via the embedding function, which is used to convert text into a vector of numbers. This vector of numbers represents the meaning of the text. The zero-shot classifier uses the embedding function to compare the meaning of the text to the meaning of the categories.Cosine similarity is a measure of similarity between two vectors. The zero-shot classifier uses cosine similarity to compare the meaning of the text to the meaning of the categories.This approach significantly reduces architectural overhead compared to prompt-based classifiers that rely on generative models, resulting in a more scalable and resource-efficient solution. For instance, using an embedding/transformer model instead of a generative model can reduce the cost by a factor of ten. Additionally, the zero-shot classifier's ability to utilize pre-computed categories further enhances its performance and efficiency.ConclusionZero Hero is a simple and powerful zero-shot classifier that is easy to use and works well for a variety of tasks. It is a good choice for anyone who needs to classify text that is unlabeled or that has little data.Development InstructionsInstall Dependencies:poetry install --with devConfigure pre-commit hooks:poetry run pre-commit installManually run black:poetry run black zerohero/* tests/*Manually run pylint:poetry run pylint zerohero/* tests/*
zerohertzLib
โšก Zerohertz's Library โšก$sudoaptinstallpython3-opencv-y $pipinstallzerohertzLib $pipinstallzerohertzLib[api]$pipinstallzerohertzLib[mlops]$pipinstallzerohertzLib[quant]$pipinstallzerohertzLib[all]importzerohertzLibaszz
zero-hid
HID python library for emulating mouse and keyboard on PI.SetupInstall apt dependenciessudoapt-getupdate sudoapt-getinstall-ygitpython3-fullinstallusb gadget moduleInstallzero-hidwithpippip3installzero-hidUsageNote: You should connect the data usb port (left one) to the raspberry, and NOT the power portControl mousefromzero_hidimportMousem=Mouse()foriinrange(5):m.move(10,10)Control keyboardfromzero_hidimportKeyboardk=Keyboard()k.type('Hello world!')FeaturesRelative / Absolute mouse movementsLeft / Right / Middle clickScrollingTypingHot keysDrag and DropEasy to setupComprehensive TestingExamplesseeexamplesTestsRaspberry Pi ModelRaspbian VersionKernel VersionRaspberry Pi 4Raspbian 126.1Raspberry Pi ZeroRaspbian 5.10-GotachesError when installing with piperror:externally-managed-environmentSeehow-solve-error-externally-managed-environment-when-installing-pip3Or simply executesudorm-rf/usr/lib/python3.11/EXTERNALLY-MANAGED
zeroinger
zeroingerๆๅ‡็ผ–็ ๆ•ˆ็Ž‡๏ผŒๆœ‰ๆ•ˆๅปถ้•ฟ็จ‹ๅบ็Œฟๅฏฟๅ‘ฝ็š„ๅฐๅทฅๅ…ท้›†็›ฎๅฝ•ๅฎ‰่ฃ…ไพ่ต–ๆกไปถpip3ๅฎ‰่ฃ…ไฝฟ็”จๆ–นๆณ•ๆ—ถ้—ด็›ธๅ…ณExcel/CSV่ฏปๅ†™้…็ฝฎๆ–‡ไปถ่ฏปๅ–ๆ–‡ๆœฌๆ–‡ไปถ่ฏปๅ†™ๆ›ดๆ–ฐๆ—ฅๅฟ—ๅฎ‰่ฃ…ไพ่ต–ๆกไปถpython>=3.6.0logzero==1.5.0pip3ๅฎ‰่ฃ…pip3 install --upgrade zeroingerไฝฟ็”จๆ–นๆณ•ๆ—ถ้—ด็›ธๅ…ณStopWatchfrom zeroinger.time.stopwatch import StopWatch import time # ๅˆ›ๅปบๅฎžไพ‹ timer = StopWatch.create_instance() time.sleep(1) # ่Žทๅ–ไปŽๅผ€ๅง‹ๅˆฐ็Žฐๅœจ็š„่€—ๆ—ถ print('ๅฝ“ๅ‰่€—ๆ—ถ',timer.duration()) # ๆทปๅŠ ไธ€ไธช่ฎกๆ—ถๅฟซ็…ง cost = timer.add_snapshot() print('ๅฟซ็…ง1ๆ—ถ้—ด็‚น', cost) time.sleep(1) cost = timer.add_snapshot() print('ๅฟซ็…ง2ๆ—ถ้—ด็‚น', cost) snapshot_list = timer.list_snapshot() print('ๆ‰€ๆœ‰ๅฟซ็…งๆ—ถ้—ด็‚น', snapshot_list) # ้‡็ฝฎ่ฎกๆ—ถๅ™จ timer.reset() #-------------------------------- ๅฝ“ๅ‰่€—ๆ—ถ 1004 ๅฟซ็…ง1ๆ—ถ้—ด็‚น 1005 ๅฟซ็…ง2ๆ—ถ้—ด็‚น 2006 ๆ‰€ๆœ‰ๅฟซ็…งๆ—ถ้—ด็‚น [1005, 2006]Excel/CSV็›ธๅ…ณXLSX่ฏปๅ–excelfrom zeroinger.excel.xlsx import XLSX test_read_file_path = os.path.join(os.path.dirname(__file__), 'read_test_file.xlsx') data = XLSX.read_dict_sheet(test_read_file_path, 0) print(data) #-------------- [{'ๅˆ—1': 1, 'ๅˆ—2': 4, 'ๅˆ—3': 7}, {'ๅˆ—1': 2, 'ๅˆ—2': 5, 'ๅˆ—3': 8}, {'ๅˆ—1': 3, 'ๅˆ—2': 6, 'ๅˆ—3': 9}]ๅ†™ๅ…ฅexcelfrom zeroinger.excel.xlsx import XLSX golden = [{'ๅˆ—1': 1, 'ๅˆ—2': 4, 'ๅˆ—3': 7}, {'ๅˆ—1': 2, 'ๅˆ—2': 5, 'ๅˆ—3': 8}, {'ๅˆ—1': 3, 'ๅˆ—2': 6, 'ๅˆ—3': 9}] test_write_file_path = os.path.join(os.path.dirname(__file__), 'write_test_file.xlsx') XLSX.write_dict_sheet(test_write_file_path, golden)ๅŽ‹็ผฉๆ–‡ไปถ่ฏปๅ†™ๆ›ดๆ–ฐๆ—ฅๅฟ—2020/01/06 ๆ–ฐๅขžๅŽ‹็ผฉๆ–‡ไปถ่ฏปๅ–ๆ–นๆณ•
zerokno
ZeroKnoZeroKno is a simple, easy to use and lightweight zero-knowledge password storage method for Python.InstallationpipinstallzeroknoUsagefromzeroknoimportZeroKno# Create a new ZeroKno instancezk=ZeroKno()# Add a new passwordzk.store("password","userid")# Check password matchzk.validate("password","userid")# Truezk.validate("passwor1d","userid")# Falsezk.validate("password","userid1")# Error: Userid not found
zero-knowledge-access-pass-authorizer
What is this?Zero-Knowledge Access Pass (ZKAP) Authorizer is aTahoe-LAFSstorage-system plugin which authorizes storage operations based on privacy-respecting passes.Such passes derive fromPrivacyPass. They allow a Tahoe-LAFS client to prove it has a right to access without revealing additional information.CopyrightCopyright 2019 PrivateStorage.io, LLCLicensed under the Apache License, Version 2.0 (the โ€œLicenseโ€); you may not use this file except in compliance with the License. You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an โ€œAS ISโ€ BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
zerokspot.recipe.distutils
UNKNOWN
zerokspot.recipe.git
ImportantThis package is no longer actively maintained and therefor wonโ€™t see any new features added to it. For more information please check outthe wikiThis simple recipe for zc.buildout fetches data from a given repository and stores it into its partโ€™s directory. A simple task using this could look like this:[myapp] recipe=zerokspot.recipe.git repository=git://github.com/zerok/zerokspot.gitrecipe.git rev=7c73978b55fcadbe2cd6f2abbefbedb5a85c2c8cThis would store the repository under ${buildout:directory}/parts/myapp and keep it at exactly this revision, no matter what happens on the server.The recipe has following options:repositoryThe absolute URL of the repository to be fetchedrevA revision/commit within this repository the environment should use.branchIf you want to stay up to date with a certain branch other than โ€œmasterโ€, use this.pathsList of relative paths to packages to develop. Must be used together with as_egg=true.newestThis overrides the newest-option of the global setting for this partas_eggSet to True if you want the checkout to be registered as a development egg in your buildout.cache-nameName of the repository in the download-cache directory.recursiveFollow submodules (Note that submodules are not cloned from the download cache).Offline installationIf you want to install a part from the download-cache, this is now possible, too:[buildout] parts = myapp download-cache = /var/cache/buildout install-from-cache = true [mylib] recipe = zerokspot.recipe.git repository = http://domain.com/repo.gitWith this configuration, the recipe will look for /var/cache/buildout/repo and clone it into the local parts/ folder.The recipe also supports an additional โ€œcache-nameโ€ setting that lets you configure the folder name of the repository in the download cache.
zerolab-django-email-views
Failed to fetch description. HTTP Status Code: 404
zeroless
Yet anotherร˜MQwrapper for Python. However, differing fromPyZMQ, which tries to stay very close to the C++ implementation, this project aims to make distributed systems employingร˜MQas pythonic as possible.Being simpler to use, Zeroless doesnโ€™t supports all of the fine aspects and features ofร˜MQ. However, you can expect to find all the message passing patterns you were accustomed to (i.e. pair, request/reply, publisher/subscriber, push/pull). Depite that, the only transport available is TCP, as threads are not as efficient in Python due to the GIL and IPC is unix-only.Installation$pipinstallzerolessPython APIIn thezerolessmodule, two classes can be used to define how distributed entities are related (i.e.ServerandClient). To put it bluntly, with the exception of the pair pattern, a client may be connected to multiple servers, while a server may accept incoming connections from multiple clients.Both servers and clients are able to create acallableand/oriterable, depending on the message passing pattern. So that you can iterate over incoming messages and/or call to transmit a message.All examples assume:fromzerolessimport(Server,Client)Push-PullUseful for distributing the workload among a set of workers. A common pattern in the Stream Processing field, being the cornestone of applications like Apache Storm for instance. Also, it can be seen as a generalisation of the Map-Reduce pattern.# Binds the pull server to port 12345# And assigns an iterable to wait for incoming messageslisten_for_push=Server(port=12345).pull()formsginlisten_for_push:print(msg)# Connects the client to as many servers as desiredclient=Client()client.connect_local(port=12345)# Initiate a push client# And assigns a callable to push messagespush=client.push()formsgin[b"Msg1",b"Msg2",b"Msg3"]:push(msg)Publisher-SubscriberUseful for broadcasting messages to a set of peers. A common pattern for allowing real-time notifications at the client side, without having to resort to inneficient approaches like pooling. Online services like PubNub or IoT protocols like MQTT are examples of this pattern usage.# Binds the publisher server to port 12345# And assigns a callable to publish messages with the topic 'sh'pub=Server(port=12345).pub(topic=b'sh',embed_topic=True)# Gives publisher some time to get initial subscriptionssleep(1)formsgin[b"Msg1",b"Msg2",b"Msg3"]:pub(msg)# Connects the client to as many servers as desiredclient=Client()client.connect_local(port=12345)# Initiate a subscriber client# Assigns an iterable to wait for incoming messages with the topic 'sh'listen_for_pub=client.sub(topics=[b'sh'])fortopic,msginlisten_for_pub:print(topic,' - ',msg)Note: ZMQโ€™s topic filtering capabilities are publisher side since ZMQ 3.0.Last but not least, SUB sockets that bind will not get any message before they first ask for via the provided generator, so prefer to bind PUB sockets if missing some messages is not an option.Request-ReplyUseful for RPC style calls. A common pattern for clients to request data and receive a response associated with the request. The HTTP protocol is well-known for adopting this pattern, being it essential for Restful services.# Binds the reply server to port 12345# And assigns a callable and an iterable# To both transmit and wait for incoming messagesreply,listen_for_request=Server(port=12345).reply()formsginlisten_for_request:print(msg)reply(msg)# Connects the client to as many servers as desiredclient=Client()client.connect_local(port=12345)# Initiate a request client# And assigns a callable and an iterable# To both transmit and wait for incoming messagesrequest,listen_for_reply=client.request()formsgin[b"Msg1",b"Msg2",b"Msg3"]:request(msg)response=next(listen_for_reply)print(response)PairMore often than not, this pattern will be unnecessary, as the above ones or the mix of them suffices most use cases in distributed computing. Regarding its capabilities, this pattern is the most similar alternative to usual posix sockets among the aforementioned patterns. Therefore, expect one-to-one and bidirectional communication.# Binds the pair server to port 12345# And assigns a callable and an iterable# To both transmit and wait for incoming messagespair,listen_for_pair=Server(port=12345).pair()formsginlisten_for_pair:print(msg)pair(msg)# Connects the client to a single serverclient=Client()client.connect_local(port=12345)# Initiate a pair client# And assigns a callable and an iterable# To both transmit and wait for incoming messagespair,listen_for_pair=client.pair()formsgin[b"Msg1",b"Msg2",b"Msg3"]:pair(msg)response=next(listen_for_pair)print(response)LoggingThezerolessmodule allows logging via a globalLogger object.fromzerolessimportlogTo enable it, just add anHandler objectand set an appropriatelogging level.TestingTo run individual tests:$py.testtests/test_desired_module.pyTo run all the tests:$pythonsetup.pytestAlternatively, you can use tox:$toxNeed help?For more information, please see ourdocumentation.LicenseCopyright 2014 Lucas Lira [email protected] library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.This library 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 Lesser General Public License for more details.You should have received a copy of the GNU Lesser General Public License along with this library. If not, seehttp://www.gnu.org/licenses/.
zeroless-tools
Most people used to networking programming are aware that NetCat is a very useful tool to establish and test TCP/UDP connections on the fly. The ZeroMQ community, however, do not provide an equivalent application. So that, in order to test your ZMQ sockets, you would have to code your own solution. For tackling that issue, the Zeroless Command Line Interface (CLI) was created.So that you can test your 0MQ connections in a language agnostic fashion, despite the used messaging pattern.Installation$pipinstallzeroless-toolsUsage$zeroserver-husage:ZerolessServerCli[-h][-namountofparts][aportbetween1024and65535]{rep,push,sub,pair,req,pub,pull}...TheZerolessServerClishallcreateanendpointforacceptingconnectionsandbindittothechosenร˜MQmessagingpatternpositionalarguments:[aportbetween1024and65535]theopenporttobind/connecttooptionalarguments:-h,--helpshowthishelpmessageandexit-namountofparts,--numPartsamountofpartstheamountofparts(i.e.frames)permessage(default=1)messagingpattern:Theร˜MQAPIimplementsseveralmessagingpatterns,eachonedefiningaparticularnetworktopology{rep,push,sub,pair,req,pub,pull}ChooseamongPublish/Subscribe(Pub/Sub),Request/Reply(Req/Rep),Pipeline(Push/Pull)andExclusivePair(Pair)Thisprogramisfreesoftware:youcanredistributeitand/ormodifyitunderthetermsoftheGNUGeneralPublicLicenseaspublishedbytheFreeSoftwareFoundation,eitherversion3oftheLicense,or(atyouroption)anylaterversion$zeroclient-husage:ZerolessClientCli[-h][-iIP][-namountofparts][aportbetween1024and65535]{sub,push,pair,pull,req,rep,pub}...TheZerolessClientClishallconnecttothespecifiedendpointusingthechosenร˜MQmessagingpatternpositionalarguments:[aportbetween1024and65535]theopenporttobind/connecttooptionalarguments:-h,--helpshowthishelpmessageandexit-iIP,--ipIPtheIPoftheendpointtoconnectto(default=127.0.0.1)-namountofparts,--numPartsamountofpartstheamountofparts(i.e.frames)permessage(default=1)messagingpattern:Theร˜MQAPIimplementsseveralmessagingpatterns,eachonedefiningaparticularnetworktopology{rep,push,sub,pair,req,pub,pull}ChooseamongPublish/Subscribe(Pub/Sub),Request/Reply(Req/Rep),Pipeline(Push/Pull)andExclusivePair(Pair)Thisprogramisfreesoftware:youcanredistributeitand/ormodifyitunderthetermsoftheGNUGeneralPublicLicenseaspublishedbytheFreeSoftwareFoundation,eitherversion3oftheLicense,or(atyouroption)anylaterversionTestingTo run individual tests:$py.testtests/test_desired_module.pyTo run all the tests:$pythonsetup.pytestAlternatively, you can use tox:$toxLicenseCopyright 2014 Lucas Lira [email protected] program is free software: you can redistribute it and/or modify it under the terms of the GNU 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 General Public License for more details.You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
zerolib
UNKNOWN
zerolibs
zerolib
zeroloader.py
ZeroLoaderZeroLoader is a part of0archive project. Its purpose is to read 0archive's public data fromgoogle driveinto csv format.SetupGet google api credentialsFollow Step 1 fromthis tutorial.Installation It's recommended to use avirtualenvorconda env.$pipinstall-Uzeroloader.pyCreate environment filetouch.envechoGDRIVE_PUBLIC_FILE_MAPPING_ID=1OwAGYg7dJob_VMW8vt2FP4fO5Ie7B3EW>.envLoad dataYou need the producer_id to successfully load. The id of each producer could be found from google drive folder name or from thiscsv.importzeroloaderaszldf=zl.load_data(:producer_id,:yyyy-mm,:path-to-gdrive-api-credentials)# e.g. Load 2020 June's data of storm.mg into a csvdf=zl.load_data("5030bba7-81fe-11ea-8627-f23c92e71bad","2020-06","service.json")
zerolog
No description available on PyPI.
zeromessage
Zero MessageZero Messageis a lightweight ROS-like pub-sub tool for Python 3.4+.Provides a wrapper aroundZeroMQsocket.Communicate between any Python program using publisher-subscriber protocolInstallationpip install zeromessageQuick startRefer to the/examples:# listener.pyimportasynciofromzeromessageimportEnvelopSocketsocket=EnvelopSocket.as_subscriber()defdoSomething(msg):print(msg)subscribe_coroutine=socket.subscribe('test',doSomething)asyncio.get_event_loop().run_until_complete(subscribe_coroutine())# talker.pyimporttimefromzeromessageimportEnvelopSocketsocket=EnvelopSocket.as_publisher()whileTrue:socket.publish('test',{'data':[1,2,3]})time.sleep(1)Command Line toolsArostopiclike tool is provided.zerotopic echo -- --helpAPI Documentzero-message.readthedocs.io
zeroml
zeromlcookiecutterhttps://github.com/waynerv/cookiecutter-pypackage.git\n
zero-motorcycles
Zero MotorcyclesTable of ContentsInstallationUsageLicenseInstallationpip install zero-motorcyclesUsagefromzero_motorcyclesimportZerozero_client=Zero(username="email",password="password")# Get unitszero_client.get_units()# Get last transmit data for a specific unitzero_client.get_last_transmit(123456)# Get subscription expiration for a specific unitzero_client.get_expiration_date(123456)Licensezero-motorcyclesis distributed under the terms of theBSD 3-Clauselicense.
zeromq-pyre
No description available on PyPI.
zeroncy
ZeroncyA simple python tool to make your projet more decoupled.Just put your project variables on a config file instead store in encironment variable. You can use a .env for json file...Installingpip install zeroncyHow to UseUsing .env filecreate a .env file in project root and set variables...DATABASE_URL=postgres://user:pwd@localhost:5432/psql ALLOWED_HOSTS=localhost, 127.0.0.0.1 PORT=5000Then you could use your variables on your settings module...>>>importzeroncy>>>zeroncy.config()>>>zeroncy.get("DATABASE_URL")'postgres://user:pwd@localhost:5432/psql'# If you want a diferent type you can pass the cast parameter>>>zeroncy.get("PORT",cast=int)5000# If your var has more than one value, you must set the many parameter to true...>>>zeroncy.get("ALLOWED_HOSTS",many=True)['localhost','127.0.0.0.1']Using .env.json fileCreate a .env.json file on project root:{"DATABASE_URL":"postgres://user:pwd@localhost:5432/psql","ALLOWED_HOSTS":"localhost, 127.0.0.0.1","PORT":5000}Then you could use on a similar way as the previous>>>importzeroncy>>>zeroncy.config(dict)# passes dict as parameter>>>zeroncy.get("DATABASE_URL")'postgres://user:pwd@localhost:5432/psql'>>>zeroncy.get("PORT")5000>>>zeroncy.get("ALLOWED_HOSTS",many=True)['localhost','127.0.0.0.1']# Note that on Json config you don't need to passes cast parameter for other types (Integer in this example)ReferencesThis project was inpired bypython-decouplelib, it's a simpler adaptionPython DocsLICENSEGNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007Copyright (C) 2007 Free Software Foundation, Inc.https://fsf.org/Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
zeronet
No description available on PyPI.
zeronetx
ZeroNetDecentralized websites using Bitcoin crypto and the BitTorrent network -https://zeronet.dev/ZeroNet Site, Unlike Bitcoin, ZeroNet Doesn't need a blockchain to run, But uses cryptography used by BTC, to ensure data integrity and validation.Why?We believe in open, free, and uncensored network and communication.No single point of failure: Site remains online so long as at least 1 peer is serving it.No hosting costs: Sites are served by visitors.Impossible to shut down: It's nowhere because it's everywhere.Fast and works offline: You can access the site even if Internet is unavailable.FeaturesReal-time updated sitesNamecoin .bit domains supportEasy to setup: unpack & runClone websites in one clickPassword-lessBIP32based authorization: Your account is protected by the same cryptography as your Bitcoin walletBuilt-in SQL server with P2P data synchronization: Allows easier site development and faster page load timesAnonymity: Full Tor network support with .onion hidden services instead of IPv4 addressesTLS encrypted connectionsAutomatic uPnP port openingPlugin for multiuser (openproxy) supportWorks with any browser/OSHow does it work?After startingzeronet.pyyou will be able to visit zeronet sites usinghttp://127.0.0.1:43110/{zeronet_address}(eg.http://127.0.0.1:43110/1HELLoE3sFD9569CLCbHEAVqvqV7U2Ri9d).When you visit a new zeronet site, it tries to find peers using the BitTorrent network so it can download the site files (html, css, js...) from them.Each visited site is also served by you.Every site contains acontent.jsonfile which holds all other files in a sha512 hash and a signature generated using the site's private key.If the site owner (who has the private key for the site address) modifies the site and signs the newcontent.jsonand publishes it to the peers. Afterwards, the peers verify thecontent.jsonintegrity (using the signature), they download the modified files and publish the new content to other peers.Slideshow about ZeroNet cryptography, site updates, multi-user sites ยปFrequently asked questions ยปZeroNet Developer Documentation ยปScreenshotsMore screenshots in ZeroNet docs ยปHow to joinWindowsDownloadZeroNet-win.zip(26MB)Unpack anywhereRunZeroNet.exemacOSDownloadZeroNet-mac.zip(14MB)Unpack anywhereRunZeroNet.appLinux (x86-64bit)wget https://github.com/ZeroNetX/ZeroNet/releases/latest/download/ZeroNet-linux.zipunzip ZeroNet-linux.zipcd ZeroNet-linuxStart with:./ZeroNet.shOpen the ZeroHello landing page in your browser by navigating to:http://127.0.0.1:43110/Tip:Start with./ZeroNet.sh --ui_ip '*' --ui_restrict your.ip.addressto allow remote connections on the web interface.Android (arm, arm64, x86)minimum Android version supported 21 (Android 5.0 Lollipop)APK download:https://github.com/canewsin/zeronet_mobile/releasesAndroid (arm, arm64, x86) Thin Client for Preview Only (Size 1MB)minimum Android version supported 16 (JellyBean)DockerThere is an official image, built from source at:https://hub.docker.com/r/canewsin/zeronet/Install from sourcewget https://github.com/ZeroNetX/ZeroNet/releases/latest/download/ZeroNet-src.zipunzip ZeroNet-src.zipcd ZeroNetsudo apt-get updatesudo apt-get install python3-pipsudo python3 -m pip install -r requirements.txtStart with:python3 zeronet.pyOpen the ZeroHello landing page in your browser by navigating to:http://127.0.0.1:43110/Current limitationsFile transactions are not compressedNo private sitesHow can I create a ZeroNet site?Click onโ‹ฎ>"Create new, empty site"menu item on the siteZeroHello.You will beredirectedto a completely new site that is only modifiable by you!You can find and modify your site's content indata/[yoursiteaddress]directoryAfter the modifications open your site, drag the topright "0" button to left, then presssignandpublishbuttons on the bottomNext steps:ZeroNet Developer DocumentationHelp keep this project aliveBitcoin: 1ZeroNetyV5mKY9JF1gsm82TuBXHpfdLX (Preferred)LiberaPay:https://liberapay.com/PramUkeshPaypal:https://paypal.me/PramUkeshOthers:DonateThank you!More info, help, changelog, zeronet sites:https://www.reddit.com/r/zeronetx/Come, chat with us:#zeronet @ FreeNodeor ongitterEmail:[email protected]
zeronimo
A distributed RPC solution based onร˜MQandgevent. Follow the features:A worker can return, yield, raise any picklable object to the remote customer.A customer can invoke to any remote worker in the worker cluster.A customer can invoke to all remote workers in the worker cluster.ExampleServer-sideThe address is 192.168.0.41. The worker will listen at 24600.importzmq.greenaszmqimportzeronimoclassApplication(object):defrycbar123(self):forwordin'run, you clever boy; and remember.'.split():yieldwordctx=zmq.Context()# make workerworker_sock=ctx.socket(zmq.PULL)worker_sock.bind('tcp://*:24600')worker=zeronimo.Worker(Application(),[worker_sock])# run worker foreverworker.run()Client-sideThe address is 192.168.0.42. The reply collector will listen at 24601.importzmq.greenaszmqimportzeronimoctx=zmq.Context()# make remote result collectorcollector_sock=ctx.socket(zmq.PULL)collector_sock.bind('tcp://*:24601)collector=zeronimo.Collector(collector_sock,'tcp://192.168.0.42:24601')# make customercustomer_sock=ctx.socket(zmq.PUSH)customer_sock.connect('tcp://192.168.0.41:24600')customer=zeronimo.Customer(customer_sock,collector)# rpcremote_result=customer.emit('rycbar123')forlineinremote_result.get():printline
zeroone
Project Zero One
zeroone-ai
School research projectI created this package for my school research project. I want to create an AI that can predict if a human where to get a heart failure. For this I created a very long python file but I wanted to make this easier to understand. So, I created this package to get a shorter file and make it easier to understand.How to useThis package uses the scikit-learn package and therefore some classes like the MLPRegressor are the same.Import the package: โ€œimport zeroone_aiโ€Choose wich class you are going to use: โ€œfrom zeroone_ai import MLPRegressor(More comming in the future)Licensescikit-learn (new BSD)https://pypi.org/project/scikit-learn/pandas (BSD 3-Clause License)https://github.com/pandas-dev/pandas/blob/master/LICENSEmatplotlib (Python Software Foundation License (PSF))https://pypi.org/project/matplotlib/3.4.3/numpy (BSD License (BSD))https://github.com/numpy/numpy/blob/main/LICENSE.txtChange Log0.0.11 (18-11-2021)You can now predict unknown data when using the new mapping feature0.0.10 (27-10-2021)The LogisticRegressor bug has been fixedPlots will now always show0.0.9 (27-10-2021)The AI now predicts a zero or an oneAdded MLPClassifier and LogisticRegressor0.0.8 (21-10-2021)Added epoch training0.0.7 (20-10-2021)Fixed a bug where the library couldnโ€™t be imported0.0.4 (19-10-2021)Fixed some bugs and provided a better README file0.0.3 (19-10-2021)Fixed some bugs and provided a better README file0.0.2 (19-10-2021)Test if updating worksโ€ฆ It does0.0.1 (19-10-2021)First Release
zeropdk
ZeroPDKThis is a pure-python PDK factory that enables klayout scripted layout. It assists in photonic integrated circuit layout, which relies on having specialized curved waveguides and non-square-corner shapes.InstallationThis package is heavily based on python'sklayout package, still in beta version as of this writing (Jul 2019).Installation with pip (virtual environment is highly recommended):pipinstallzeropdkInstallation from source:pythonsetup.pyinstallFeaturesKLayout extensionBy importing zeropdk, klayout is patched with a few useful functionalities. For example:importklayout.dbaskdbimportzeropdklayout=kdb.Layout()plogo=layout.read_cell(cell_name='princeton_logo',filepath='gdslibrary/princeton_logo_simple.gds')# plogo is a cell in the current layout. It can be inserted in the top cell.Easy technology layers definitionBased on a KLayout's layout properties file (.lyp) containing layer definitions, it is easy to import and use all layers. For example:fromzeropdkimportTechlyp_path="examples/EBeam.lyp"EBeam=Tech.load_from_xml(lyp_path)layerM1=EBeam.layers["M1"]print(layerM1,type(layerM1))# M1 (41/0) <class 'klayout.dbcore.LayerInfo'>The file above belongs to a project calledSiEPIC EBeam PDK, used in passive silicon photonic foundries.Advanced PCell definitionPCells can be hierarchical, as described inSec. IV.C of this article. One PCell can use another PCell in its definition, and the parent pcell should, in this case, inherit the child's parameters. an example taken fromzeropdk.default_library.iois:classDCPadArray(DCPad):params=ParamContainer(pad_array_count,pad_array_pitch)defdraw(self,cell):# ...foriinrange(cp.pad_array_count):dcpad=DCPad(name=f"pad_{i}",params=cp)returncell,portsIn this case,DCPadArraysimply places an array ofDCPadPcells, and contains parameterspad_array_countand alsopad_array_pitch, but also the parameters belonging toDCPad, such aslayer_metalandlayer_opening.In the EBeam PDK example, one can edit adapt a standard library of pcells to its own parameter sets. For example, EBeam PDK uses particular layers for its metal deposition and oxide etch steps. So the DCPadArray can be changed via the following:classDCPadArray(DCPadArray):params=ParamContainer(PCellParameter(name="layer_metal",type=TypeLayer,description="Metal Layer",default=EBeam.layers["M1"],),PCellParameter(name="layer_opening",type=TypeLayer,description="Open Layer",default=EBeam.layers["13_MLopen"],),)TODO: adapt example providedhereto zeropdk.Photonics-inspired layout functionsSeveral assistive tools for handling photonic shapes. For example, it is desired, sometimes, to draw a waveguide with progressive widths (a taper).fromzeropdk.layoutimportlayout_waveguidewav_polygon=layout_waveguide(cell,layer,points_list,width)Developer notesThis project is still under development phase. See thedevelopment notesfor more information.AcknowledgementsThis material is based in part upon work supported by the National Science Foundation under Grant Number E2CDA-1740262. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.
zerophone
No description available on PyPI.
zerophone-api-daemon
No description available on PyPI.
zerophone-hw
No description available on PyPI.
zero-play
Zero PlayTeach a computer to play any gameThe zero play library is based on the ideas in theAlphaGo Zero paperand the example Python code in thealpha-zero-general project. The goal of this project is to make a reusable Python library that other projects can build on to make powerful computer opponents for many different board games. An example project that uses this library isShibumi Games.It includes a graphical display that you can use to play against the computer opponent or another human.Installing Zero PlayEven though Zero Play has a graphical display, it is a regular Python package, so you can install it withpip install zero-play. If you haven't installed Python packages before, read Brett Cannon'squick-and-dirty guide.Then run it with thezero_playcommand.The default installation generates some errors aboutbdist_wheelthat don't seem to actually cause any problems. You can either ignore them, or installwheelbefore installing Zero Play.pip install wheel pip install zero-play zero_playKnown bug on Ubuntu 20.04:qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.This is aPySide2 bugthat is missing some dependencies. You can work around it by installing those dependencies like this:sudo apt install libxcb-xinerama0More InformationIf you'd like to help out with the project, or add your own games, see theCONTRIBUTING.mdfile in the source code. For all the details, look through the designjournalfor the project.Related ProjectsHere are some similar projects for inspiration or collaboration:I already mentioned thealpha-zero-general project. It was a big inspiration, but I'm trying to build something that's easier to add new games to, or use as a library within another project.Galvaniselooks interesting. It's a mix of Python and C++, using Tensorflow. As of 2020, it looks like a single developer, without much documentation. The games are defined with GDL, not Python code.
zero-point
soon
zeropos
A zeroconf based POS printing daemonWhat is Zero POSZero POS was designed to solve a very specific problem we faced at Openlabs, but we thought could be generic enough for others to use. Here is the use case:The Tryton iPad based POS should be able to print to the commonly found POS printer - a thermal printer like the Epson TM-T81. The printer only talks over USB and does not have wireless printing capabilities!With zeropos, you could bundle the printer with a low cost computer like the Raspberry Pi and connect the printer to it and run zeropos daemon on the raspberry pi. The printing service can be discovered over zero conf from the iPad application and your application could send a POST request to the service to print ZPL to the printer.InstallationThe quickest way to install this software is using pippip install zeroposAdministrationThe daemon can be adminisered by opening the service URL from a browser.TODOImplement secutiry for the admin interface.Write API documentation for the admin HTTP API.
zeropwn
No description available on PyPI.
zeropy
zeropyBlockchain's api bind, python3.5+RequirementsracryptcrcPy(now part, but it will be changed)TestsDefault tests:shtests.shTesting Api:cdtests vimnode.ini changeip,port python3-munittesttest_client.pyStartimportzeropyclient=zeropy.apiClient()client.connect('127.0.0.1',5000)tmp_key=b'any 64 symbols'#Blockchain should know with whom he worksclient.send_info(tmp_key)counters=client.get_counters()print('blocks\n',counters.blocks,'transactions\n',counters.transactions,'binary data\n',counters)
zero-python-sdk
Zero Python SDKPython SDK forZero. Provides a clear and simple interface for the secrets manager GraphQL API.Installationpoetryaddzero-python-sdkUsageFetch your vendor secrets by passing yourzerotoken:importosfromzero_python_sdkimportzeroZERO_TOKEN=os.getenv("ZERO_TOKEN")# {'aws': {'secret': 'value', 'secret2': 'value2'}, 'googleCloud': {...}}print(zero(token=ZERO_TOKEN,pick=["aws","googleCloud"],caller_name="stagingcluster").fetch())
zerorm
Zerorm is a simple wrapper for three amazing packages. This repository is the place whereTinyDB,SchematicsandLiftertogether look like Django ORM.Itโ€™s still work in progress and not everything looks like Django ORM, but it will.InstallationpipinstallzerormUsageFirst create a file with models and database instance attached to every model:fromzerormimportdb,modelsdatabase=db('db.json')classMessage(models.Model):author=models.StringType(required=True)author_email=models.EmailType()text=models.StringType()views=models.IntType(min_value=0)classMeta:database=databaseNow create some objects:>>>frommodelsimportMessage>>>>>>bob_message=Message(author='Bob',...author_email='[email protected]',...text='Hello, everyone!')>>>bob_message<Message: Message object>>>>bob_message.save()# Save object1>>>>>>bob_message.views=3>>>bob_message.save()# Update object>>>>>>alice_message=Message.objects.create(author='Alice',...text='Hi, Bob!',...views=0)>>>alice_message<Message: Message object>And try to retrieve them viaobjects>>>Message.objects.all()<QuerySet, len() = 2>>>>list(Message.objects.all())[<Message: Message object>, <Message: Message object>]>>>>>>second_message=Message.objects.get(eid=2)>>>second_message.author'Alice'>>>>>>Message.objects.filter(views__gte=3)# Only Bob's message has 3 views<QuerySet, len() = 1>>>>list(Message.objects.filter(views__gte=3))[<Message: Message object>]You can also redefine modelโ€™s__str__method for better repr just like in Django.classMessage(models.Model):...def__str__(self):return'by{}'.format(self.author)>>>list(Message.objects.all())[<Message: by Bob>, <Message: by Alice>]LicenseMIT. See LICENSE for details.
zeroros
Zero-dependency ROS-like middleware for PythonThis library is intended to be used for small projects that require a simple middleware for communication between processes. It is not intended to be a replacement for ROS.Why ZeroROS?See these discussions inROS Discourseand this one inreddit/ROS.InstallationUse pip to install the library:pipinstallzerorosUsageThe library is composed of three main classes:Publisher,SubscriberandMessageBroker.MessageBrokerTheMessageBrokerclass is used to create a message broker that can be used by publishers and subscribers to communicate with each other.fromzerorosimportMessageBrokerbroker=MessageBroker()PublisherThePublisherclass is used to publish messages to a topic. The constructor takes two arguments: the topic name and the message type. The topic name is a string, while the message type is a Python class. The message type is used to serialize and deserialize messages.fromzerorosimportPublisherpub=Publisher("topic_name",String)pub.publish("Hello world!")SubscriberTheSubscriberclass is used to subscribe to a topic and receive messages. The constructor takes two arguments: the topic name and the message type. The topic name is a string, while the message type is a Python class. The message type is used to serialize and deserialize messages.importtimefromzerorosimportSubscriberdefcallback(msg):print(msg)sub=Subscriber("topic_name",String,callback)whileTrue:# Do something elsetime.sleep(1)# Stop the subscribersub.stop()MessagesThe library comes with a few built-in messages that can be used out of the box. The following messages are available:std_msgs.Stringstd_msgs.Intstd_msgs.Floatstd_msgs.Boolstd_msgs.Headergeometry_msgs.Vector3geometry_msgs.Vector3Stampedgeometry_msgs.Twistgeometry_msgs.Quaterniongeometry_msgs.Posegeometry_msgs.PoseStampedgeometry_msgs.PoseWithCovariancegeometry_msgs.TwistWithCovariancenav_msgs.Odometrynav_msgs.Pathsensors_msgs.LaserScanMore to come...LoggingThis library implements a class calledDataLoggerthat can be used to log data in JSON format. To use the logger, simply create an instance of the class and call thelogmethod with the data to be logged. The data can be any Python object that can be serialized to JSON.fromzerorosimportDataLoggerfromzeroros.messagesimportStringlogger=DataLogger("log_file.json")msg=String()msg.data="Hello world!"logger.log(msg,topic_name="/topic_name")The content of the log file will be:[{"class":"String","topic_name":"/topic_name","timestamp":1622126400.0,"message":{"data":"Hello world!"}}]In the examples folder you will find a python script to convert JSON logs into CSV files.
zerorpc
Mailing list:[email protected](https://groups.google.com/d/forum/zerorpc)zerorpc is a flexible RPC implementation based on zeromq and messagepack. Service APIs exposed with zerorpc are called โ€œzeroservicesโ€.zerorpc can be used programmatically or from the command-line. It comes with a convenient script, โ€œzerorpcโ€, allowing to:expose Python modules without modifying a single line of code,call those modules remotely through the command line.InstallationOn most systems, its a matter of:$ pip install zerorpcDepending of the support from Gevent and PyZMQ on your system, you might need to installlibev(for gevent) andlibzmq(for pyzmq) with the development files.Create a server with a one-linerLetโ€™s see zerorpc in action with a simple example. In a first terminal, we will expose the Python โ€œtimeโ€ module:$ zerorpc --server --bind tcp://*:1234 timeNoteThe bind address uses the zeromq address format. You are not limited to TCP transport: you could as well specify ipc:///tmp/time to use host-local sockets, for instance. โ€œtcp://*:1234โ€ is a short-hand to โ€œtcp://0.0.0.0:1234โ€ and means โ€œlisten on TCP port 1234, accepting connections on all IP addressesโ€.Call the server from the command-lineNow, in another terminal, call the exposed module:$ zerorpc --client --connect tcp://127.0.0.1:1234 strftime %Y/%m/%d Connecting to "tcp://127.0.0.1:1234" "2011/03/07"Since the client usecase is the most common one, โ€œโ€“clientโ€ is the default parameter, and you can remove it safely:$ zerorpc --connect tcp://127.0.0.1:1234 strftime %Y/%m/%d Connecting to "tcp://127.0.0.1:1234" "2011/03/07"Moreover, since the most common usecase is toconnect(as opposed tobind) you can also omit โ€œโ€“connectโ€:$ zerorpc tcp://127.0.0.1:1234 strftime %Y/%m/%d Connecting to "tcp://127.0.0.1:1234" "2011/03/07"See remote service documentationYou can introspect the remote service; it happens automatically if you donโ€™t specify the name of the function you want to call:$ zerorpc tcp://127.0.0.1:1234 Connecting to "tcp://127.0.0.1:1234" tzset tzset(zone) ctime ctime(seconds) -> string clock clock() -> floating point number struct_time <undocumented> time time() -> floating point number strptime strptime(string, format) -> struct_time gmtime gmtime([seconds]) -> (tm_year, tm_mon, tm_mday, tm_hour, tm_min, mktime mktime(tuple) -> floating point number sleep sleep(seconds) asctime asctime([tuple]) -> string strftime strftime(format[, tuple]) -> string localtime localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,Specifying non-string argumentsNow, see what happens if we try to call a function expecting a non-string argument:$ zerorpc tcp://127.0.0.1:1234 sleep 3 Connecting to "tcp://127.0.0.1:1234" Traceback (most recent call last): [...] TypeError: a float is requiredThatโ€™s because all command-line arguments are handled as strings. Donโ€™t worry, we can specify any kind of argument using JSON encoding:$ zerorpc --json tcp://127.0.0.1:1234 sleep 3 Connecting to "tcp://127.0.0.1:1234" [wait for 3 seconds...] nullzeroworkers: reversing bind and connectSometimes, you donโ€™t want your client to connect to the server; you want your server to act as a kind of worker, and connect to a hub or queue which will dispatch requests. You can achieve this by swapping โ€œโ€“bindโ€ and โ€œโ€“connectโ€:$ zerorpc --bind tcp://*:1234 strftime %Y/%m/%dWe now have โ€œsomethingโ€ wanting to call the โ€œstrftimeโ€ function, and waiting for a worker to connect to it. Letโ€™s start the worker:$ zerorpc --server tcp://127.0.0.1:1234 timeThe worker will connect to the listening client and ask him โ€œwhat should I do?โ€; the client will send the โ€œstrftimeโ€ function call; the worker will execute it and return the result. The first program will display the local time and exit. The worker will remain running.Listening on multiple addressesWhat if you want to run the same server on multiple addresses? Just repeat the โ€œโ€“bindโ€ option:$ zerorpc --server --bind tcp://*:1234 --bind ipc:///tmp/time timeYou can then connect to it using either โ€œzerorpctcp://*:1234โ€ or โ€œzerorpc ipc:///tmp/timeโ€.Wait, there is more! You can even mix โ€œโ€“bindโ€ and โ€œโ€“connectโ€. That means that your server will wait for requests on a given address,andconnect as a worker on another. Likewise, you can specify โ€œโ€“connectโ€ multiple times, so your worker will connect to multiple queues. If a queue is not running, it wonโ€™t affect the worker (thatโ€™s the magic of zeromq).WarningA client should probably not connect to multiple addresses!Almost all other scenarios will work; but if you ask a client to connect to multiple addresses, and at least one of them has no server at the end, the client will ultimately block. A client can, however, bind multiple addresses, and will dispatch requests to available workers. If you want to connect to multiple remote servers for high availability purposes, you insert something like HAProxy in the middle.Exposing a zeroservice programmaticallyOf course, the command-line is simply a convenience wrapper for the zerorpc python API. Below are a few examples.Hereโ€™s how to expose an object of your choice as a zeroservice:class Cooler(object): """ Various convenience methods to make things cooler. """ def add_man(self, sentence): """ End a sentence with ", man!" to make it sound cooler, and return the result. """ return sentence + ", man!" def add_42(self, n): """ Add 42 to an integer argument to make it cooler, and return the result. """ return n + 42 def boat(self, sentence): """ Replace a sentence with "I'm on a boat!", and return that, because it's cooler. """ return "I'm on a boat!" import zerorpc s = zerorpc.Server(Cooler()) s.bind("tcp://0.0.0.0:4242") s.run()Letโ€™s save this code tocooler.pyand run it:$ python cooler.pyNow, in another terminal, letโ€™s try connecting to our awesome zeroservice:$ zerorpc -j tcp://localhost:4242 add_42 1 43 $ zerorpc tcp://localhost:4242 add_man 'I own a mint-condition Volkswagen Golf' "I own a mint-condition Volkswagen Golf, man!" $ zerorpc tcp://localhost:4242 boat 'I own a mint-condition Volkswagen Golf, man!' "I'm on a boat!"Congratulations! You have just made the World a little cooler with your first zeroservice, man!
zerorpc2
No description available on PyPI.
zerorpc-2
No description available on PyPI.
zerorpc-statsd
UNKNOWN
zerorunner-consul
zerorunner-consulPython client for Consul (https://www.consul.io/)GitHub
zeroscale
zeroscaleScale-to-zero any serverSome servers don't idle well. Either they constantly suck CPU doing nothing (like Minecraft keeping spawn chunks always loaded), or they do things you don't want them to while no clients are connected. If you have control over the program, you could design it to do nothing while no clients are connected, but if you don't, how can you prevent this waste?zeroscalesits in front of a server and only spins it up when someone tries to connect to it, proxying the connection. It can pause a server when no clients are connected, and unpause it on connection, completely transparently proxying the connection. It also supports shutting down the server when no clients are connected, and while starting it up, send a message to the client telling the user to wait.Usageusage: zeroscale [-h] [--listen_port LISTEN_PORT] [--server_host SERVER_HOST] [--server_port SERVER_PORT] [--plugin PLUGIN] [--method_stop] [--idle_shutdown IDLE_SHUTDOWN] [--shutdown_timeout SHUTDOWN_TIMEOUT] [--plugin_argument PLUGIN_ARGUMENT] [--ignore_bad_clients] [--info] [--debug] [--working_directory WORKING_DIRECTORY] [--pause_signal PAUSE_SIGNAL] [--unpause_signal UNPAUSE_SIGNAL] [--stop_signal STOP_SIGNAL] Scale a server to zero. optional arguments: -h, --help show this help message and exit --listen_port LISTEN_PORT, -p LISTEN_PORT Port for the proxy server, where clients will connect. Defaults to 8080 --server_host SERVER_HOST, -H SERVER_HOST Hostname that the real server will be listening on. Defaults to localhost. --server_port SERVER_PORT, -P SERVER_PORT Port that the real server will be listening on. Defaults to the value of listen_port --plugin PLUGIN Package name of the server plugin. Must be in plugins dir. Defaults to the generic provider. --method_stop, -m Instead of pausing the process, stop it completely. This isn't recommended since extra startup time will be needed. --idle_shutdown IDLE_SHUTDOWN, -t IDLE_SHUTDOWN Time in seconds after last client disconects to shutdown the server. Default 15. --shutdown_timeout SHUTDOWN_TIMEOUT, -s SHUTDOWN_TIMEOUT Time in seconds after proxy server gets SIGINT to kill the server. Default 15. --plugin_argument PLUGIN_ARGUMENT, -a PLUGIN_ARGUMENT Arguments to pass to the Server() constructor in the plugin. Can be called multiple times. --ignore_bad_clients, -b Disable checking for a bad client connection. This would prevent port scanners from starting servers, but if your real clients are failing the check, you can disable it. This is implemented by each server plugin. The default plugin has no check. --info, -i Enable info logging. --debug, -d Enable debug logging. Default is WARNING --working_directory WORKING_DIRECTORY, -w WORKING_DIRECTORY Directory to start the server process. --pause_signal PAUSE_SIGNAL Signal to send to the server process to pause it. In int form. Default 20 (SIGTSTP) --unpause_signal UNPAUSE_SIGNAL Signal to send to the server process to unpause it. In int form. Default 18 (SIGCONT) --stop_signal STOP_SIGNAL Signal to send to the server process to stop it. In int form. Default 2 (SIGINT). Note that some plugins will use stdin to stop their process, in which case this flag will be ignored.Example$ zeroscale --plugin minecraft -p 25565 -P 25575 --debug INFO:zeroscale.plugins.minecraft:Starting Minecraft server INFO:zeroscale.plugins.minecraft:Minecraft server online DEBUG:zeroscale.zeroscale:Scheduling Minecraft server stop DEBUG:zeroscale.zeroscale:Listening on ('::', 25565, 0, 0) DEBUG:zeroscale.zeroscale:Listening on ('0.0.0.0', 25565) DEBUG:zeroscale.zeroscale:No clients online for 15 seconds INFO:zeroscale.plugins.minecraft:Pausing Minecraft server ... DEBUG:zeroscale.zeroscale:New connection, server is paused DEBUG:zeroscale.zeroscale:Invalid client attempted connection # Detects invalid client ... DEBUG:zeroscale.zeroscale:New connection, server is paused INFO:zeroscale.plugins.minecraft:Unpausing Minecraft server DEBUG:zeroscale.zeroscale:New connection, total clients: 1 # Proxies connection transparently ... DEBUG:zeroscale.zeroscale:Lost connection, total clients: 0 DEBUG:zeroscale.zeroscale:Scheduling Server server stop ... DEBUG:zeroscale.zeroscale:No clients online for 15 seconds INFO:zeroscale.plugins.minecraft:Pausing Minecraft serverAnd an example of the stopping method:$ zeroscale --plugin minecraft -p 25565 -P 25575 -method_stop --debug DEBUG:zeroscale.zeroscale:Listening on ('::', 25565, 0, 0) DEBUG:zeroscale.zeroscale:Listening on ('0.0.0.0', 25565) ... DEBUG:zeroscale.zeroscale:New connection, server is stopped DEBUG:zeroscale.zeroscale:Invalid client attempted connection # Detects invalid client ... DEBUG:zeroscale.zeroscale:New connection, server is stopped DEBUG:zeroscale.zeroscale:Sending fake response # Actually shows valid server message in client! INFO:zeroscale.plugins.minecraft:Starting Minecraft server ... INFO:zeroscale.plugins.minecraft:Minecraft server online DEBUG:zeroscale.zeroscale:Scheduling Server server stop ... DEBUG:zeroscale.zeroscale:New connection, server is running DEBUG:zeroscale.zeroscale:New connection, total clients: 1 DEBUG:zeroscale.zeroscale:Canceling Server server stop ... DEBUG:zeroscale.zeroscale:Lost connection, total clients: 0 DEBUG:zeroscale.zeroscale:Scheduling Server server stop ... DEBUG:zeroscale.zeroscale:No clients online for 15 seconds INFO:zeroscale.plugins.minecraft:Stopping Minecraft server INFO:zeroscale.plugins.minecraft:Minecraft server offlineDockerThere is also a Docker version that can control docker containers. Instead of starting and stopping the process, it starts, stops, and pauses the container.Usageusage: docker-zeroscale [-h] [--listen_port LISTEN_PORT] [--server_host SERVER_HOST] [--server_port SERVER_PORT] [--plugin PLUGIN] [--method_stop] [--idle_shutdown IDLE_SHUTDOWN] [--shutdown_timeout SHUTDOWN_TIMEOUT] [--plugin_argument PLUGIN_ARGUMENT] [--ignore_bad_clients] [--info] [--debug] [--disable_exit_stop] container_id Scale a container to zero. positional arguments: container_id ID or name of the Docker container to control. Must already exist. Will also try to connect to this container as the server to proxy unless server_host is set. optional arguments: -h, --help show this help message and exit --listen_port LISTEN_PORT, -p LISTEN_PORT Port for the proxy server, where clients will connect. Defaults to 8080 --server_host SERVER_HOST, -H SERVER_HOST Hostname that the real server will be listening on. Defaults to localhost. --server_port SERVER_PORT, -P SERVER_PORT Port that the real server will be listening on. Defaults to the value of listen_port --plugin PLUGIN Package name of the server plugin. Must be in plugins dir. Defaults to the generic provider. --method_stop, -m Instead of pausing the process, stop it completely. This isn't recommended since extra startup time will be needed. --idle_shutdown IDLE_SHUTDOWN, -t IDLE_SHUTDOWN Time in seconds after last client disconects to shutdown the server. Default 15. --shutdown_timeout SHUTDOWN_TIMEOUT, -s SHUTDOWN_TIMEOUT Time in seconds after proxy server gets SIGINT to kill the server. Default 15. --plugin_argument PLUGIN_ARGUMENT, -a PLUGIN_ARGUMENT Arguments to pass to the Server() constructor in the plugin. Can be called multiple times. --ignore_bad_clients, -b Disable checking for a bad client connection. This would prevent port scanners from starting servers, but if your real clients are failing the check, you can disable it. This is implemented by each server plugin. The default plugin has no check. --info, -i Enable info logging. --debug, -d Enable debug logging. Default is WARNING --disable_exit_stop Disable stopping the controlled container on exit.Docker usageIf you want to rundocker-zeroscalein its own container, there is an image for that, but you will need to make a few changes.Thedocker.sockmust be mounted in the container, so that it can control the proxied container.The port that the proxy server will listen on needs to be specified twice: once as an argument to Docker to tell it to open the port, and once to the proxy server to tell it to listen on that port.Since you don't want the non-proxied port exposed externally, make the proxied server listen on a non published port (don't use-pwhen starting it), and connect the zeroscale proxy server to the same Docker network.All together, the run command would look like this:docker run \ --network my_network \ -v /var/run/docker.sock:/var/run/docker.sock:ro \ -p 25565:25565 \ rycieos/zeroscale \ proxied_container_id \ --listen_port=25565docker-zeroscaleassumes that the container it is controlling is listening on the hostname of the container and the same port as the proxy server is listening on by default.Docker composeSince two containers need to work closely together, it's probably best to use docker-compose to spin them up.version: '3' services: my_server: image: my_server container_name: my_server restart: always networks: - network zeroscale: image: rycieos/zeroscale restart: always ports: - 25565:25565 volumes: - /var/run/docker.sock:/var/run/docker.sock:ro command: - my_server - --listen_port=25565 depends_on: - my_server networks: - network networks: network: driver: bridgePluginsMinecraftThe original problem server that spawned this project. Should just work, but if using the pausing method (which is the default), you will need to set themax-tick-timeoption in theserver.propertiesto-1to prevent the server crashing on unpause. While it is possible for a process to detect that it was paused, Minecraft does not, and it sees a tick as having taken way too long, and force restarts the server.If the server needs to be started up (using method stop), it will correctly show the server as online, but with a message that it is unavailable.TerrariaTerraria server. Just works. Shows an error message if the server isn't online.Custom pluginsAny server can run behind the proxy, simply override any methods of theGenericServerin your own module in the "plugins/" directory. The only methods you need to override areis_valid_connection()andfake_status(). If you don't override those, you are probably better off just using thegenericplugin.from .generic import Server as GenericServer class Server(GenericServer): def __init__(self, # Any parameters, will come from --plugin_argument params ): super().__init__(True) self.name = "Plugin name" async def start(self): if self.status is not Status.stopped: return logger.info('Starting server') self.status = Status.starting # Whatever to run the server, probably an await asyncio.create_subprocess_exec() logger.info('Server online') self.status = Status.running async def stop(self): if self.status is not Status.running: return logger.info('Stopping server') self.status = Status.stopping # Whatever to stop the server logger.info('Server offline') self.status = Status.stopped async def is_valid_connection(self, client_reader): return # If the connection is from a valid client (to stop port scanners) def fake_status(self) -> bytes: return # Some bytes for when a client tries to connect and the server is not onlineSystemdExample systemd configs are located in systemd/ to accompany the plugins.Known issuesPlugins that use subprocess pipes to read stdin, stdout, or stderr don't work on Cygwin, as the OS is seen as posix and thus doesn't ship with the ProactorEventLoop, but since the backend OS is Windows, the default event loop won't work. This is a bug in the Cygwin Python package.
zeroscratches
Zero ScratchesOld Photo RestorationThis is a lightweight implementation ofMicrosoft Bringing Old Photos Back to LifeInstallpipinstallzeroscatchesBasic usageimportPIL.ImagefromzeroscratchesimportEraseScratchesimage_path="/path/to/image-scratched.jpg"eraser=EraseScratches()image=PIL.Image.open(image_path)new_img=eraser.erase(image)new_img=PIL.Image.fromarray(new_img)new_img.show()Get the pretrained models atHugging Face Zero ScratchesSome Apps using the library:Face ShineFace Shine Is a backend server for photo enhancement and restoration.Super FaceSuper Face is a Python QT frontend for Face Shine server.
zero-sdk
No description available on PyPI.
zeroset
zerosetUseful collection of features
zeroshot
Zeroshot (Python)Image classification for the massesInstallationInstall via pip:pip install zeroshotFor GPU support,pip install zeroshot[torch]N.B. In theory ONNX supports GPU, but the restrictions on CUDA version are iffy at best, and so for easiest results just use PyTorch. If you're brave, insteadpip install onnxruntime-gpu.UsageFirst, go to app.usezeroshot.com and create a classifier. Check out the video on thelanding pagefor an example.Then, in Python (imageshould be an RGB numpy array with channels last):importzeroshot# Create the classifier and preprocessing function.classifier=zeroshot.Classifier("model-uuid-goes-here")preprocess_fn=zeroshot.create_preprocess_fn()# Run the model!prediction=classifier.predict(preprocess_fn(image))print(f"The image is class{prediction}")You can also download the classifier and save it somewhere locally so you don't need to hit the server each time. Hit "download model" in the web-app and save the json file somewhere. You can then instead do:classifier=zeroshot.Classifier("/home/user/path/to/model.json")Additional TipsTo use a GPU, install the torch backend withpip install zeroshot[torch]If you are hitting issues with torch trying to run on CPU, try disabling XFormers by setting XFORMERS_DISABLED=1 in your ENV varaibles.Read the docsSee thedocsfolder for some details on how things work under the hood.Get helpIf you need help or just want to chat, join theMoonshine Labs Slack serverand come hang out in the #zeroshot channel.
zeroshot-classifier
code and data for the Findings of ACLโ€™23 paper Label Agnostic Pre-training for Zero-shot Text Classification by Christopher Clarke, Yuzhao Heng, Yiping Kang, Krisztian Flautner, Lingjia Tang and Jason Mars
zero-shot-re
IntroductionThis is a zero-shot relation extractor based on the paperExploring the zero-shot limit of FewRel.Installation$pipinstallzero-shot-reRun the ExtractorfromtransformersimportAutoTokenizerfromzero_shot_reimportRelTaggerModel,RelationExtractormodel=RelTaggerModel.from_pretrained("fractalego/fewrel-zero-shot")tokenizer=AutoTokenizer.from_pretrained("fractalego/fewrel-zero-shot")relations=['noble title','founding date','occupation of a person']extractor=RelationExtractor(model,tokenizer,relations)ranked_rels=extractor.rank(text='John Smith received an OBE',head='John Smith',tail='OBE')print(ranked_rels)with results[('noble title',0.9690611883997917),('occupation of a person',0.0012609362602233887),('founding date',0.00024014711380004883)]AccuracyThe results as in the paper areModel0-shot 5-ways0-shot 10-ways(1) Distillbert70.1ยฑ0.555.9ยฑ0.6(2) Bert Large80.8ยฑ0.469.6ยฑ0.5(3) Distillbert + SQUAD81.3ยฑ0.470.0ยฑ0.2(4) Bert Large + SQUAD86.0ยฑ0.676.2ยฑ0.4This version uses the (4) Bert Large + SQUAD modelCite as@inproceedings{cetoli-2020-exploring,title="Exploring the zero-shot limit of {F}ew{R}el",author="Cetoli, Alberto",booktitle="Proceedings of the 28th International Conference on Computational Linguistics",month=dec,year="2020",address="Barcelona, Spain (Online)",publisher="International Committee on Computational Linguistics",url="https://www.aclweb.org/anthology/2020.coling-main.124",doi="10.18653/v1/2020.coling-main.124",pages="1447--1451",abstract="This paper proposes a general purpose relation extractor that uses Wikidata descriptions to represent the relation{'}s surface form. The results are tested on the FewRel 1.0 dataset, which provides an excellent framework for training and evaluating the proposed zero-shot learning system in English. This relation extractor architecture exploits the implicit knowledge of a language model through a question-answering approach.",}
zeroshot-topics
Table of ContentsInstallationLicenseInstallationzeroshot_topics is distributed onPyPIas a universal wheel and is available on Linux/macOS and Windows and supports Python 3.7+ and PyPy.$pipinstallzeroshot_topicsLicensezeroshot_topics is distributed under the terms ofMIT LicenseApache License, Version 2.0
zeroslib
ๅญฆ่€Œๆ€zeroๅทฅไฝœๅฎคไธ“็”จๅบ“
zerosms
zerosms==============Send a text message via Way2SMS to your friends and family in India. Enter your India mobile number and sms text message as parameters. Your Free SMS sending to India will be delivered instantly----Description: zerosms==============It is python package to Send a text message via "Way2SMS"Send a text message to your friends and family in India. Enter your India mobile number and sms text message as parameters. Your Free SMS sending to India will be delivered instantlyRequirements============================BeautifulSoup4requestsurllib3 1.22NOTE============================use Way2Sms site credentials to send sms and future message----Example Code------------Open Python Interpreter::>>> import zerosms>>> zerosms.sms(phno=phonenum,passwd=password,message='helloworld!!',receivernum=receiver mobile number)>>> zerosms.futuresms(phno=phno,passwd=password,set_time='17:47',set_date='15/12/2017',receivernum=receiver mobile num,message='helloworld!!')
zero-socialauth
Simple app to add social authentication in django projects
zerospeech-benchmarks
Zero Resource Challenge Benchmark ToolkitThis repository contains a toolbox assisting in running and handling all things related to the zerospeech benchmarks. For more information on theZero Resource Challenge you can visit our website.This toolbox allows to download all resources linked with the benchmarks (datasets, model checkpoints, samples, etc..), to run the various benchmarks on your own submissions, and to upload the results to our website for them to be included in our leaderboards.The available resources can be also found directly on our repositorydownload.zerospeech.comInstallationThe zerospeech benchmark toolbox is a python package, so you require a version of python installed on your system before you can start.You can useminicondaa lightweight version of anaconda or any other way of installing python you prefer.Note that the package has been tested on python 3.8+, other versions are not recommended.Once python is installed you can install the package using :pip install "zerospeech-benchmarks[all]"If you are a conda user you can use our prepackaged environment :conda env create coml/zrc-toolkitTo verify that the toolbox is installed correctly you can tryzrc versionwhich should print the version information. If this is not the case you can open an issue with your errors on directly on ourgithubToolbox UsageDownloadsInstallation location can be specified using the environment variableAPP_DIR, in linux & macOS this can be done in a terminal:$ export APP_DIR=/location/to/dataBy default, all data is saved in$HOME/zr-dataAll temporary files are saved in/tmpthis can be changed using the environment variableTMP_DIRDownload benchmark datasetsYou can start by listing the available datasets using the commandzrc datasetsthen you can download the dataset you want using the commandzrc datasets:pull [dataset-name].When listing datasets theInstalledcolumn specifies whether the dataset has been downloaded.Datasets are installed in the$APP_DIR/datasetsfolder. To delete a dataset you can use the commandzrc dataset:rm [dataset-name]Download model checkpointsThe commandzrc checkpointsallows you to list available checkpoints.You can then download each set by typingzrc checkpoints:pull [name]Checkpoints are installed in the$APP_DIR/checkpointsfolder.To delete the checkpoints you can use the command :zrc checkpoints:rm [name]Download samplesThe commandzrc samplesallows you to list the available samples.You can then download each sample by typingzrc samples:pull [name]. Samples are installed in the$APP_DIR/samplesfolder.To delete a sample from your system you can usezrc samples:rm [name]BenchmarksYou can list available benchmarks by typing thezrc benchmarkscommand.To create a submission you have to follow the instructions on each of our task pagesTask1,Task2,Task3,Task4Some older benchmarks may not be available straight away, but they will be added as soon as possible.Once the submission has been created you can run the benchmark on it with the following command :zrc benchmarks:run [name] [/path/to/submission] [...args]Some benchmarks are split into sub-tasks you can run partial tasks by using the following syntax:zrc benchmarks:run sLM21 [/path/to/submission] -t lexical syntacticWith this syntax we run the sLM21 benchmark our submission but only for the lexical and syntactic task and we omit the semantic.In the same way we can also only run on the dev set (or the test) :zrc benchmarks:run sLM21 [/path/to/submission] -s dev -t lexical syntacticWe run the same tasks as previously but only on the dev set of the benchmark.For information on each benchmark you can run thezrc benchmarks:info [name]command or visit the corresponding section on our websitezerospeech.comSubmission FormatEach benchmark has a specific format that a submission has to follow, you can initialize a submission directory by using the following syntax :zrc submission:init [name] [/path/to/desired-location-for-submission], this will create a set of folders in the architecture corresponding to the benchmark name selected. For more detailed information on each benchmark you can see each Task page respectively.Once all submission files have been created your can validate your submission to see if everything is working properly. To do so use the following syntax :zrc submission:verify [name] [/path/to/submission]this will verify that all files are set up correctly, or show informative errors if not.Note:During benchmark evaluation the default behavior is to run validation on your submission, you can deactivate this by adding the option--skip-verification.SubmitThe submit functionality allows uploading scores to our platform, this helps us keep track of new models or new publications that happen using the benchmarks also we compile all the scores into our leaderboards to be able to compare them.The submit functionality is a Work in progress, it will be available soon.
zerospeech-libriabx
LibriLight ABXThis is a wrapper module around the abx implementation found inlibri-light/eval. This module only adds a wrapper function to directly call abx evaluation and a dataclass object annotating all arguments as well as a setup.py to allow installation as a module.InstallationYou can install this module from pip directly using the following command :pip install zerospeech-libriabxOr you can install from source by cloning this repository and running :pip install .UsageFrom command lineA command line is created to allow running abx evaluations.usage: libri-abx [-h] [--path_checkpoint PATH_CHECKPOINT] [--file_extension {.pt,.npy,.wav,.flac,.mp3}] [--feature_size FEATURE_SIZE] [--cuda] [--mode {all,within,across}] [--distance_mode {euclidian,cosine,kl,kl_symmetric}] [--max_size_group MAX_SIZE_GROUP] [--max_x_across MAX_X_ACROSS] [--out OUT] path_data path_item_file ABX metric positional arguments: path_data Path to directory containing the data path_item_file Path to the .item file optional arguments: -h, --help show this help message and exit --path_checkpoint PATH_CHECKPOINT Path to a CPC checkpoint. If set, the apply the model to the input data to compute the features --file_extension {.pt,.npy,.wav,.flac,.mp3} --feature_size FEATURE_SIZE Size (in s) of one feature --cuda Use the GPU to compute distances --mode {all,within,across} Choose the mode of the ABX score to compute --distance_mode {euclidian,cosine,kl,kl_symmetric} Choose the kind of distance to use to compute the ABX score. --max_size_group MAX_SIZE_GROUP Max size of a group while computing theABX score. A small value will make the code faster but less precise. --max_x_across MAX_X_ACROSS When computing the ABX across score, maximumnumber of speaker X to sample per couple A,B. A small value will make the code faster but less precise. --out OUT Path where the results should be savedFrom python APITo call the abx evaluation from python code you can use the following example :frompathlibimportPathimportlibriabxargs=libriabx.AbxArguments(path_data=Path("/location/to/scores/")path_item_file=Path("/location/to/file.item")**other_options)result=libriabx.abx_eval(args)For all possible options see theAbxArguments class definition.Result is a dictionary containing Dict{mode -> score} where mode is defined as (across, within)Building & UploadFor security & compatibility reasons binary builds require a special environment to be build. We need to use the manylinux docker container so that correct flags are used.To do this run :>dockerpullquay.io/pypa/manylinux2014_x86_64 >dockerrun--rm-v`pwd`:/ioquay.io/pypa/manylinux2014_x86_64bash/io/build_wheel.shTo check for pyversions availabledocker run --rm quay.io/pypa/manylinux2014_x86_64 ls /opt/pythonThis allows to populate with compiled versions of libriabx for python3.8, python3.9, python3.10, python3.11 in the dist folder. For more information seeManyLinux ImplementationOnce binaries have been build we can upload them to pypi using :twine upload dist/*
zerospeech-libriabx2
libri-light-abx2The ABX phonetic evaluation metric for unsupervised representation learning as used by the ZeroSpeech challenge, now with context-type options (on-triphone, within-context, any-context). This module is a reworking ofhttps://github.com/zerospeech/libri-light-abx, which in turn is a wrapper aroundhttps://github.com/facebookresearch/libri-light/tree/main/evalInstallationYou can install this module from pip directly using the following command :pip install zerospeech-libriabx2Or you can install from source by cloning this repository and running:pip install .As the final alternative, you can install into a conda environment by running:conda install -c conda-forge -c pytorch -c coml zerospeech-libriabx2 pytorch::pytorchUsageFrom command lineusage: zrc-abx2 [-h] [--path_checkpoint PATH_CHECKPOINT] [--file_extension {.pt,.npy,.wav,.flac,.mp3,.npz,.txt}] [--feature_size FEATURE_SIZE] [--cuda] [--speaker_mode {all,within,across}] [--context_mode {all,within,any}] [--distance_mode {euclidian,euclidean,cosine,kl,kl_symmetric}] [--max_size_group MAX_SIZE_GROUP] [--max_x_across MAX_X_ACROSS] [--out OUT] [--seed SEED] [--pooling {none,mean,hamming}] [--seq_norm] [--max_size_seq MAX_SIZE_SEQ] [--strict] path_data path_item_file ABX metric positional arguments: path_data Path to directory containing the submission data path_item_file Path to the .item file containing the timestamps and transcriptions optional arguments: -h, --help show this help message and exit --path_checkpoint PATH_CHECKPOINT Path to a CPC checkpoint. If set, apply the model to the input data to compute the features --file_extension {.pt,.npy,.wav,.flac,.mp3,.npz,.txt} --feature_size FEATURE_SIZE Size (in s) of one feature --cuda Use the GPU to compute distances --speaker_mode {all,within,across} Choose the speaker mode of the ABX score to compute --context_mode {all,within,any} Choose the context mode of the ABX score to compute --distance_mode {euclidian,euclidean,cosine,kl,kl_symmetric} Choose the kind of distance to use to compute the ABX score. --max_size_group MAX_SIZE_GROUP Max size of a group while computing the ABX score. A small value will make the code faster but less precise. --max_x_across MAX_X_ACROSS When computing the ABX across score, maximum number of speaker X to sample per couple A,B. A small value will make the code faster but less precise. --out OUT Path where the results should be saved --seed SEED Seed to use in random sampling. --pooling {none,mean,hamming} Type of pooling over frame representations of items. --seq_norm Used for CPC features only. If activated, normalize each batch of feature across the time channel before computing ABX. --max_size_seq MAX_SIZE_SEQ Used for CPC features only. Maximal number of frames to consider when computing a batch of features. --strict Used for CPC features only. If activated, each batch of feature will contain exactly max_size_seq frames.Python APIYou can also call the abx evaluation from python code. You can use the following example:import zrc_abx2 args = zrc_abx2.EvalArgs( path_data= "/location/to/representations/", path_item_file= "/location/to/file.item", **other_options ) result = zrc_abx2.EvalABX().eval_abx(args)Information on evaluation conditionsA new variable in this ABX version is context. In the within-context condition, a, b, and x have the same surrounding context (i.e. the same preceding and following phoneme). any-context ignores the surrounding context; typically, it varies.For the within-context and any-context comparison, use an item file that extracts phonemes (rather than XYZ triphones). For the on-triphone condition, which is still available, use an item file that extracts triphones (just like in the previous abx evaluation), and then run it within-context (which was the default behavior of the previous abx evaluation). any-context is not used for the on-triphone version due to excessive noise that would be included in the representation.Like in the previous version, it is also possible to run within-speaker (a, b, x are all from the same speaker) and across-speaker (a and b are from the same speaker, x is from another) evaluations. So there are four phoneme-based evaluation combinations in total: within_s-within_c, within_s-any-c, across_s-within_c, across_s-any_c; and two triphone-based evaluation combinations: within_s-within_c, across_s-within_c.
zerospeech-tde
Term Discovery EvaluationToolbox to evaluate Term Discovery systems.Complete Documentation and metrics description ar available athttps://docs.cognitive-ml.fr/tde/This toolbox transcribed phonetical each discovered interval, then applies NLP evaluation to judge the quality of the discovery. The metrics are:NED : mean of the edit distance between all the discovered pairscoverage: percentage of the corpus coveredtoken/type: measure how good the system was at finding gold tokens and gold typesboundary: measure how good the system was at finding gold boundariesgrouping: judge the purity of the clusters formed by the system
zerossl
Package that provides a CLI to interact with ZeroSSL API
zerotest
Zerotest makes it easy to test API server, start a micro proxy, send requests, and generate test code by these behaviours.InstallStable version:pip install zerotestDevelop version:pip installgit+https://github.com/jjyr/zerotest.gitzerotest require python2.7 or 3.3+Quick StartStart a local proxy to capture http trafficzerotest serverhttps://api.github.com-foctocat.dataMake few requestscurl-ihttp://localhost:7000/users/octocatPressC-cto exit local proxyGenerate test codezerotest generate octocat.data--ignore-all-headers> test_octocat.pyTypepy.test test_octocat.pyto run testUsageTypezerotest-hto see help messageServerStart local proxy serverzerotest serverhttp://target-endpoint.com[-f][record_file.data]Typezerotest server-hto see help messageGenerateGenerate python test code from record data (the file generated by local proxy)zerotest generate [options] > test_file.pyIgnore specific headers in comparisonUse option--ignore-headers[date server...]or--ignore-all-headersto ignore headers comparisonIgnore specific fieldsUse--fuzzy-matchenable fuzzy matching mode, compare data schema instead the data itself, or you can use--ignore-fields[view_count...]to specific ignored fieldsTypezerotest generate-hto see help messageReplayGenerate test and run it withpytestzerotest replay [generate options][--pytest][pytest options]Typezerotest replay-hto see help messageDevelopExport debug flagZEROTEST_DEBUG=trueto see verbose logs during program or test running.ContributorsContributorsContributeOpen issue if found bugs or some cool ideasFeel free to ask if have any questionsTesting is very important for a test tool, commit your test file together with pull request
zeroth-client
No description available on PyPI.
zerotheorem
Failed to fetch description. HTTP Status Code: 404
zerotheorem-python
No description available on PyPI.
zeroth-normalizer
zeroth-normalizerProject: Zeroth์—์„œ ํ•œ๊ตญ์–ด๋ฅผ ์ฒ˜๋ฆฌํ•  ๋•Œ ์‚ฌ์šฉ๋œ normalizer์ฝ”๋“œ๋ฅผ ๋‹ค๋ฅธ ์ž‘์—…์— ์ ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ์™ธ๋ถ€ ๋ชจ๋“ˆ๋กœ ๋ถ„๋ฆฌํ•˜์˜€์Šต๋‹ˆ๋‹ค.ํ•จ์ˆ˜ ํƒ€์ž… ์ ์šฉ ๋ฐ ์ „์ฒด ์ฝ”๋“œ ํด๋ž˜์Šค๋กœ ๋ถ„๋ฆฌInstallationExamples์›๋ฌธ: ๋Œ€์™• ๋Œ€๋น„๊ฐ€ ๋Œ€ํ–‰์™•์ด ์˜ˆ(็ฟ)๋กœ์จ ์‹œํ˜ธ๋ฅผ ์‚ผ๋„๋ก ๋งํ–ˆ์—ˆ๋‹ค๊ณ  ์•Œ๋ฆฌ๋‹ค step1: ๋Œ€์™• ๋Œ€๋น„๊ฐ€ ๋Œ€ํ–‰์™•์ด ์˜ˆ๋กœ์จ ์‹œํ˜ธ๋ฅผ ์‚ผ๋„๋ก ๋งํ–ˆ์—ˆ๋‹ค๊ณ  ์•Œ๋ฆฌ๋‹ค step2: ๋Œ€์™• ๋Œ€๋น„๊ฐ€ ๋Œ€ํ–‰์™•์ด ์˜ˆ๋กœ์จ ์‹œํ˜ธ๋ฅผ ์‚ผ๋„๋ก ๋งํ–ˆ์—ˆ๋‹ค๊ณ  ์•Œ๋ฆฌ๋‹ค step3: ๋Œ€์™• ๋Œ€๋น„๊ฐ€ ๋Œ€ํ–‰์™•์ด ์˜ˆ๋กœ์จ ์‹œํ˜ธ๋ฅผ ์‚ผ๋„๋ก ๋งํ–ˆ์—ˆ๋‹ค๊ณ  ์•Œ๋ฆฌ๋‹ค step4: ๋Œ€์™• ๋Œ€๋น„๊ฐ€ ๋Œ€ํ–‰์™•์ด ์˜ˆ๋กœ์จ ์‹œํ˜ธ๋ฅผ ์‚ผ๋„๋ก ๋งํ–ˆ์—ˆ๋‹ค๊ณ  ์•Œ๋ฆฌ๋‹ค ์›๋ฌธ: ํ•œ๊ตญ์–ด ์œ„ํ‚ค๋ฐฑ๊ณผ(์˜์–ด: Korean Wikipedia)๋Š” ํ•œ๊ตญ์–ด๋กœ ์šด์˜๋˜๋Š” ์œ„ํ‚ค๋ฐฑ๊ณผ์˜ ๋‹ค์–ธ์–ดํŒ ๊ฐ€์šด๋ฐ ํ•˜๋‚˜๋กœ์„œ, 2002๋…„ 10์›” 11์ผ์— ์‹œ์ž‘๋˜์—ˆ๋‹ค. step1: ํ•œ๊ตญ์–ด ์œ„ํ‚ค๋ฐฑ๊ณผ๋Š” ํ•œ๊ตญ์–ด๋กœ ์šด์˜๋˜๋Š” ์œ„ํ‚ค๋ฐฑ๊ณผ์˜ ๋‹ค์–ธ์–ดํŒ ๊ฐ€์šด๋ฐ ํ•˜๋‚˜๋กœ์„œ , 2002 ๋…„ 10 ์›” 11 ์ผ์— ์‹œ์ž‘๋˜์—ˆ๋‹ค. step2: ํ•œ๊ตญ์–ด ์œ„ํ‚ค๋ฐฑ๊ณผ๋Š” ํ•œ๊ตญ์–ด๋กœ ์šด์˜๋˜๋Š” ์œ„ํ‚ค๋ฐฑ๊ณผ์˜ ๋‹ค์–ธ์–ดํŒ ๊ฐ€์šด๋ฐ ํ•˜๋‚˜๋กœ์„œ, 2002 ๋…„ 10 ์›” 11 ์ผ์— ์‹œ์ž‘๋˜์—ˆ๋‹ค. step3: ํ•œ๊ตญ์–ด ์œ„ํ‚ค๋ฐฑ๊ณผ๋Š” ํ•œ๊ตญ์–ด๋กœ ์šด์˜๋˜๋Š” ์œ„ํ‚ค๋ฐฑ๊ณผ์˜ ๋‹ค์–ธ์–ดํŒ ๊ฐ€์šด๋ฐ ํ•˜๋‚˜๋กœ์„œ, 2002 ๋…„ 10 ์›” 11 ์ผ์— ์‹œ์ž‘๋˜์—ˆ๋‹ค. step4: ํ•œ๊ตญ์–ด ์œ„ํ‚ค๋ฐฑ๊ณผ๋Š” ํ•œ๊ตญ์–ด๋กœ ์šด์˜๋˜๋Š” ์œ„ํ‚ค๋ฐฑ๊ณผ์˜ ๋‹ค์–ธ์–ดํŒ ๊ฐ€์šด๋ฐ ํ•˜๋‚˜๋กœ์„œ ์ด์ฒœ ์ด ๋…„ 10 ์›” 11 ์ผ์— ์‹œ์ž‘๋˜์—ˆ๋‹ค ์›๋ฌธ: ๊ณต์‹ ๋ฌธ์„œ์—๋Š” 'Corea' ๋˜๋Š” 'Korea'๊ฐ€ ํ˜ผ์šฉ๋˜์–ด ์‚ฌ์šฉ๋˜์—ˆ๊ณ , 1900๋…„๋Œ€ ์ดˆ๊ธฐ๋ถ€ํ„ฐ ์˜์–ด๊ถŒ์—์„œ๋Š” 'Korea'์˜ ์‚ฌ์šฉ ๋นˆ๋„๊ฐ€ ๋†’์•˜๋‹ค. step1: ๊ณต์‹ ๋ฌธ์„œ์—๋Š” Corea ๋˜๋Š” Korea ๊ฐ€ ํ˜ผ์šฉ๋˜์–ด ์‚ฌ์šฉ๋˜์—ˆ๊ณ  , 1900 ๋…„๋Œ€ ์ดˆ๊ธฐ๋ถ€ํ„ฐ ์˜์–ด๊ถŒ์—์„œ๋Š” Korea ์˜ ์‚ฌ์šฉ ๋นˆ๋„๊ฐ€ ๋†’์•˜๋‹ค. step2: ๊ณต์‹ ๋ฌธ์„œ์—๋Š” Corea ๋˜๋Š” Korea ๊ฐ€ ํ˜ผ์šฉ๋˜์–ด ์‚ฌ์šฉ๋˜์—ˆ๊ณ , 1900 ๋…„๋Œ€ ์ดˆ๊ธฐ๋ถ€ํ„ฐ ์˜์–ด๊ถŒ์—์„œ๋Š” Korea ์˜ ์‚ฌ์šฉ ๋นˆ๋„๊ฐ€ ๋†’์•˜๋‹ค. step3: ๊ณต์‹ ๋ฌธ์„œ์—๋Š” Corea ๋˜๋Š” Korea ๊ฐ€ ํ˜ผ์šฉ๋˜์–ด ์‚ฌ์šฉ๋˜์—ˆ๊ณ , 1900 ๋…„๋Œ€ ์ดˆ๊ธฐ๋ถ€ํ„ฐ ์˜์–ด๊ถŒ์—์„œ๋Š” Korea ์˜ ์‚ฌ์šฉ ๋นˆ๋„๊ฐ€ ๋†’์•˜๋‹ค. step4: ๊ณต์‹ ๋ฌธ์„œ์—๋Š” Corea ๋˜๋Š” Korea ๊ฐ€ ํ˜ผ์šฉ๋˜์–ด ์‚ฌ์šฉ๋˜์—ˆ๊ณ  ์ฒœ ๊ตฌ๋ฐฑ ๋…„๋Œ€ ์ดˆ๊ธฐ๋ถ€ํ„ฐ ์˜์–ด๊ถŒ์—์„œ๋Š” Korea ์˜ ์‚ฌ์šฉ ๋นˆ๋„๊ฐ€ ๋†’์•˜๋‹ค ์›๋ฌธ: ๋ถ์œ„ 33๋„~38๋„, ๋™๊ฒฝ 126~132๋„์— ๊ฑธ์ณ ์žˆ์–ด ๋ƒ‰๋Œ€ ๋™๊ณ„ ์†Œ์šฐ ๊ธฐํ›„์™€ ์˜จ๋Œ€ ํ•˜์šฐ ๊ธฐํ›„, ์˜จ๋‚œ ์Šต์œค ๊ธฐํ›„๊ฐ€ ๋‚˜ํƒ€๋‚œ๋‹ค. step1: ๋ถ์œ„ 33 ๋„ ~ 38 ๋„ , ๋™๊ฒฝ 126 ~ 132 ๋„์— ๊ฑธ์ณ ์žˆ์–ด ๋ƒ‰๋Œ€ ๋™๊ณ„ ์†Œ์šฐ ๊ธฐํ›„์™€ ์˜จ๋Œ€ ํ•˜์šฐ ๊ธฐํ›„ , ์˜จ๋‚œ ์Šต์œค ๊ธฐํ›„๊ฐ€ ๋‚˜ํƒ€๋‚œ๋‹ค. step2: ๋ถ์œ„ 33 ๋„ ~ 38 ๋„ , ๋™๊ฒฝ 126 ~ 132 ๋„์— ๊ฑธ์ณ ์žˆ์–ด ๋ƒ‰๋Œ€ ๋™๊ณ„ ์†Œ์šฐ ๊ธฐํ›„์™€ ์˜จ๋Œ€ ํ•˜์šฐ ๊ธฐํ›„ , ์˜จ๋‚œ ์Šต์œค ๊ธฐํ›„๊ฐ€ ๋‚˜ํƒ€๋‚œ๋‹ค. step3: ๋ถ์œ„ 33 ๋„ ~ 38 ๋„ , ๋™๊ฒฝ 126 ~ 132 ๋„์— ๊ฑธ์ณ ์žˆ์–ด ๋ƒ‰๋Œ€ ๋™๊ณ„ ์†Œ์šฐ ๊ธฐํ›„์™€ ์˜จ๋Œ€ ํ•˜์šฐ ๊ธฐํ›„ , ์˜จ๋‚œ ์Šต์œค ๊ธฐํ›„๊ฐ€ ๋‚˜ํƒ€๋‚œ๋‹ค. step4: ๋ถ์œ„ 33 ๋„ ~ 38 ๋„ ๋™๊ฒฝ ๋ฐฑ ์ด์‹ญ ์œก ~ ๋ฐฑ ์‚ผ์‹ญ ์ด ๋„์— ๊ฑธ์ณ ์žˆ์–ด ๋ƒ‰๋Œ€ ๋™๊ณ„ ์†Œ์šฐ ๊ธฐํ›„์™€ ์˜จ๋Œ€ ํ•˜์šฐ ๊ธฐํ›„ ์˜จ๋‚œ ์Šต์œค ๊ธฐํ›„๊ฐ€ ๋‚˜ํƒ€๋‚œ๋‹ค ์›๋ฌธ: 3.1์šด๋™ step1: 3.1 ์šด๋™ step2: 3.1 ์šด๋™ step3: 3.1 ์šด๋™ step4: ์‚ผ ์ฉœ ์ผ ์šด๋™ ์›๋ฌธ: ํ‰๊ท  ๊ธฐ์˜จ์€ 10 ~ 16โ„ƒ์ด๋ฉฐ, ๊ฐ€์žฅ ๋ฌด๋”์šด ๋‹ฌ์ธ 8์›”์€ 23 ~ 36โ„ƒ, 5์›”์€ 16 ~ 19โ„ƒ, 10์›”์€ 11 ~ 19โ„ƒ, ๊ฐ€์žฅ ์ถ”์šด ๋‹ฌ์ธ 1์›”์€ -6 ~ 3โ„ƒ์ด๋‹ค. step1: ํ‰๊ท  ๊ธฐ์˜จ์€ 10 ~ 16 ์ด๋ฉฐ , ๊ฐ€์žฅ ๋ฌด๋”์šด ๋‹ฌ์ธ 8 ์›”์€ 23 ~ 36 , 5 ์›”์€ 16 ~ 19 , 10 ์›”์€ 11 ~ 19 , ๊ฐ€์žฅ ์ถ”์šด ๋‹ฌ์ธ 1 ์›”์€ - 6 ~ 3 ์ด๋‹ค. step2: ํ‰๊ท  ๊ธฐ์˜จ์€ 10 ~ 16 ์ด๋ฉฐ , ๊ฐ€์žฅ ๋ฌด๋”์šด ๋‹ฌ์ธ 8 ์›”์€ 23 ~ 36 , 5 ์›”์€ 16 ~ 19 , 10 ์›”์€ 11 ~ 19 , ๊ฐ€์žฅ ์ถ”์šด ๋‹ฌ์ธ 1 ์›”์€ - 6 ~ 3 ์ด๋‹ค. step3: ํ‰๊ท  ๊ธฐ์˜จ์€ 10 ~ 16 ์ด๋ฉฐ , ๊ฐ€์žฅ ๋ฌด๋”์šด ๋‹ฌ์ธ 8 ์›”์€ 23 ~ 36 , 5 ์›”์€ 16 ~ 19 , 10 ์›”์€ 11 ~ 19 , ๊ฐ€์žฅ ์ถ”์šด ๋‹ฌ์ธ 1 ์›”์€ - 6 ~ 3 ์ด๋‹ค. step4: ํ‰๊ท  ๊ธฐ์˜จ์€ 10 ~ 16 ์ด๋ฉฐ ๊ฐ€์žฅ ๋ฌด๋”์šด ๋‹ฌ์ธ 8 ์›”์€ 23 ~ 36 5 ์›”์€ 16 ~ 19 10 ์›”์€ 11 ~ 19 ๊ฐ€์žฅ ์ถ”์šด ๋‹ฌ์ธ 1 ์›”์€ - 6 ~ 3 ์ด๋‹ค ์›๋ฌธ: ์˜ˆ์‹œ๋กœ์„œ, ๋งŒ์•ฝ ํฌ๊ธฐ n์˜ ๋ชจ๋“  ์ž…๋ ฅ์— ๋Œ€ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜์— ํ•„์š”ํ•œ ์‹œ๊ฐ„์ด ์ตœ๋Œ€ (์–ด๋–ค n0๋ณด๋‹ค ํฌ์ง€ ์•Š์€ ๋ชจ๋“  n์— ๋Œ€ํ•˜์—ฌ) 5n^3 + 3n์˜ ์‹์„ ๊ฐ€์ง„๋‹ค๋ฉด, ์ด ์•Œ๊ณ ๋ฆฌ์ฆ˜์˜ ์  ๊ทผ์  ์‹œ๊ฐ„ ๋ณต์žก๋„๋Š” O(n3)์ด๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ๋‹ค. step1: ์˜ˆ์‹œ๋กœ์„œ , ๋งŒ์•ฝ ํฌ๊ธฐ n ์˜ ๋ชจ๋“  ์ž…๋ ฅ์— ๋Œ€ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜์— ํ•„์š”ํ•œ ์‹œ๊ฐ„์ด ์ตœ๋Œ€ 5 n 3 + 3 n ์˜ ์‹์„ ๊ฐ€์ง„๋‹ค๋ฉด , ์ด ์•Œ๊ณ ๋ฆฌ์ฆ˜์˜ ์ ๊ทผ์  ์‹œ๊ฐ„ ๋ณต์žก๋„๋Š” O ์ด๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ๋‹ค. step2: ์˜ˆ์‹œ๋กœ์„œ , ๋งŒ์•ฝ ํฌ๊ธฐ n ์˜ ๋ชจ๋“  ์ž…๋ ฅ์— ๋Œ€ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜์— ํ•„์š”ํ•œ ์‹œ๊ฐ„์ด ์ตœ๋Œ€ 5 n 3 + 3 n ์˜ ์‹์„ ๊ฐ€์ง„๋‹ค๋ฉด , ์ด ์•Œ๊ณ ๋ฆฌ์ฆ˜์˜ ์ ๊ทผ์  ์‹œ๊ฐ„ ๋ณต์žก๋„๋Š” O ์ด๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ๋‹ค. step3: ์˜ˆ์‹œ๋กœ์„œ , ๋งŒ์•ฝ ํฌ๊ธฐ n ์˜ ๋ชจ๋“  ์ž…๋ ฅ์— ๋Œ€ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜์— ํ•„์š”ํ•œ ์‹œ๊ฐ„์ด ์ตœ๋Œ€ 5 n 3 + 3 n ์˜ ์‹์„ ๊ฐ€์ง„๋‹ค๋ฉด , ์ด ์•Œ๊ณ ๋ฆฌ์ฆ˜์˜ ์ ๊ทผ์  ์‹œ๊ฐ„ ๋ณต์žก๋„๋Š” O ์ด๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ๋‹ค. step4: ์˜ˆ์‹œ๋กœ์„œ ๋งŒ์•ฝ ํฌ๊ธฐ n ์˜ ๋ชจ๋“  ์ž…๋ ฅ์— ๋Œ€ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜์— ํ•„์š”ํ•œ ์‹œ๊ฐ„์ด ์ตœ๋Œ€ 5 n 3 + 3 n ์˜ ์‹์„ ๊ฐ€์ง„๋‹ค๋ฉด ์ด ์•Œ๊ณ ๋ฆฌ์ฆ˜์˜ ์ ๊ทผ์  ์‹œ๊ฐ„ ๋ณต์žก๋„๋Š” O ์ด๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ๋‹ค
zerotier
No description available on PyPI.
zerotk.clikit
A modern Command Line Interface library.
zerotk.easyfs
File system utilities for python.
zerotk.jenkins-job-builder
Jenkins Job Builder takes simple descriptions ofJenkinsjobs inYAMLorJSONformat and uses them to configure Jenkins. You can keep your job descriptions in human readable text format in a version control system to make changes and auditing easier. It also has a flexible template system, so creating many similarly configured jobs is easy.To install:$ pip install --user jenkins-job-builderOnline documentation:http://docs.openstack.org/infra/jenkins-job-builder/DevelopersBug report:https://storyboard.openstack.org/#!/project/723Repository:https://git.openstack.org/cgit/openstack-infra/jenkins-job-builderCloning:git clone https://git.openstack.org/openstack-infra/jenkins-job-builderA virtual environment is recommended for development. For example, Jenkins Job Builder may be installed from the top level directory:$ virtualenv .venv $ source .venv/bin/activate $ pip install -r test-requirements.txt -e .Patches are submitted via Gerrit at:https://review.openstack.org/Please do not submit GitHub pull requests, they will be automatically closed.More details on how you can contribute is available on our wiki at:http://docs.openstack.org/infra/manual/developers.htmlWriting a patchWe ask that all code submissions bepep8andpyflakesclean. The easiest way to do that is to runtoxbefore submitting code for review in Gerrit. It will runpep8andpyflakesin the same manner as the automated test suite that will run on proposed patchsets.When creating new YAML components, please observe the following style conventions:All YAML identifiers (including component names and arguments) should be lower-case and multiple word identifiers should use hyphens. E.g., โ€œbuild-triggerโ€.The Python functions that implement components should have the same name as the YAML keyword, but should use underscores instead of hyphens. E.g., โ€œbuild_triggerโ€.This consistency will help users avoid simple mistakes when writing YAML, as well as developers when matching YAML components to Python implementation.Unit TestsUnit tests have been included and are in thetestsfolder. Many unit tests samples are included as examples in our documentation to ensure that examples are kept current with existing behaviour. To run the unit tests, execute the command:tox -e py34,py27Note: Viewtox.inito run tests on other versions of Python, generating the documentation and additionally for any special notes on running the test to validate documentation external URLs from behind proxies.Installing without setup.pyFor YAML support, you will needlibyamlinstalled.Mac OS X:$ brew install libyamlThen install the required python packages usingpip:$ sudo pip install PyYAML python-jenkins
zerotk.jenkins-job-builder-pipeline
## jenkins-job-builder-pipelineA plugin for [jenkins-job-builder](http://docs.openstack.org/infra/jenkins-job-builder) to support [pipeline](https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Plugin) job generation.Build Status: [![Build Status](https://travis-ci.org/rusty-dev/jenkins-job-builder-pipeline.svg)](https://travis-ci.org/rusty-dev/jenkins-job-builder-pipeline)#### Usage:Plugin adds a new project-type `pipeline` and a job definition field `pipeline`.There are two distinct job definitions.Create a pipeline job with a DSL script:```yaml- job:name: example-scriptproject-type: pipelinepipeline:script: |# Your dsl script goes here.node {echo 'Hello world'}sandbox: true # Use groovy sandbox, false by default.```Create a pipeline job loading pipeline script from SCM.```yaml- job:name: example-scm-scriptproject-type: pipelinepipeline:script-path: subdir/Jenkinsfile # path to pipeline script definition, "Jenkinsfile" by default.scm: # normal scm definitions- git:branches:- '*/maser'url: '[email protected]:github-username/repository-name.git'basedir: 'subdir'skip-tag: truewipe-workspace: false```Definition type is chosen automatically by detecting presence of "scm" field.
zerotk.lib
Collection of basic Python utilities.
zerotk.reraiseit
A function to re-raise exceptions adding information to the traceback and with unicode support.
zerotk.url2env
url2envTurns database URLs into shell environment variables.Usage:$ url2env psql://joebloggs:[email protected]:4433/blog PGUSER=joebloggs PGPASSWORD=secret PGHOST=db.example.com PGPORT=4433 PGDATABASE=blogWith all options:$ url2env --engine --export --prefix=DB_ psql://joebloggs:[email protected]:4433/blog export DB_ENGINE=psql export DB_USER=joebloggs export DB_PASSWORD=secret export DB_HOST=db.example.com export DB_PORT=4433 export DB_DATABASE=blogThe output could be used in conjunction witheval, e.g.::$ eval $(url2env $DATABASE_URL)Installation$ pip install zerotk.url2envDistribution$ git tag <x.y> $ make build upload
zerotk.virtualenv-api
virtualenvis a tool to create isolated Python environments. Unfortunately, it does not expose a native Python API. This package aims to provide an API in the form of a wrapper around virtualenv.It can be used to create and delete environments and perform package management inside the environment.Full support is provided for Python 2.7 and Python 3.3+.InstallationThe latest stable release is available onPyPi:$ pip install virtualenv-apiPlease note that the distribution is namedvirtualenv-api, yet the Python package is namedvirtualenvapi.Alternatively, you may fetch the latest version from git:$ pip install git+https://github.com/sjkingo/virtualenv-api.gitExamplesTo begin managing an environment (it will be created if it does not exist):fromvirtualenvapi.manageimportVirtualEnvironmentenv=VirtualEnvironment('/path/to/environment/name')You may also specify the Python interpreter to use in this environment by passing thepythonargument to the class constructor (new in 2.1.3):env=VirtualEnvironment('/path/to/environment/name',python='python3')If you have already activated a virtualenv and wish to operate on it, simply callVirtualEnvironmentwith no arguments:env=VirtualEnvironment()New in 2.1.7:An optional argumentreadonlymay be provided (defaults toFalse) that will prevent all operations that could potentially modify the environment.Check if themezzaninepackage is installed:>>>env.is_installed('mezzanine')FalseInstall the latest version of themezzaninepackage:>>>env.install('mezzanine')A wheel of the latest version of themezzaninepackage (new in 2.1.4):>>>env.wheel('mezzanine')Install version 1.4 of thedjangopackage (this is pipโ€™s syntax):>>>env.install('django==1.4')Upgrade thedjangopackage to the latest version:>>>env.upgrade('django')Upgrade all packages to their latest versions (new in 2.1.7):>>>env.upgrade_all()Uninstall themezzaninepackage:>>>env.uninstall('mezzanine')Packages may be specified as name only (to work on the latest version), using pipโ€™s package syntax (e.g.django==1.4) or as a tuple of('name', 'ver')(e.g.('django', '1.4')).A package may be installed directly from a git repository (must end with.git):>>>env.install('git+git://github.com/sjkingo/cartridge-payments.git')New in 2.1.10:A package can be installed in pipโ€™seditablemode by prefixing the package name with-e(this is pipโ€™s syntax):>>>env.install('-e git+https://github.com/stephenmcd/cartridge.git')Instances of the environment provide aninstalled_packagesproperty:>>>env.installed_packages[('django','1.5'),('wsgiref','0.1.2')]A list of package names is also available in the same manner:>>>env.installed_package_names['django','wsgiref']Search for a package on PyPI (changed in 2.1.5: this now returns a dictionary instead of list):>>>env.search('virtualenv-api'){'virtualenv-api':'An API for virtualenv/pip'}>>>len(env.search('requests'))231The old functionality (pre 2.1.5) ofenv.searchmay be used:>>>list(env.search('requests').items())[('virtualenv-api','An API for virtualenv/pip')]Verbose output from each command is available in the environmentโ€™sbuild.logfile, which is appended to with each operation. Any errors are logged tobuild.err.
zerotk.xml-factory
XMl Factory is a simple XMl writer that uses dict syntax to write files.