Saravanan666/pypi-org huggingface dataset:
Package: pyfact
A python package with utils to work with the FACT Imaging Cerenkov Telescopeinstall with$ pip install pyfactThis takes automatically care of the dependencies which are installable
with pip.However, if you want to use the GUI Event Viewer you will need to
install Tkbeforeyou installmatplotlibas it depends on the
tkagg backend.functions:factincludes several functions to convert the times used in fact
data to more standard formats and vice versa.e.g. :fromfactimportrun2dt# convert fact fNight format to python datetime object:date=run2dt("20150101")SubmodulesioTo store pandas dataframes in column-oriented storage into hdf5 files,
we created some helpfull wrappers aroundpandasandh5py:fromfact.ioimportread_h5py,to_h5pyimportpandasaspddf=pd.DataFrame({'a':[1,2,3],'b':[4,5,6]})to_h5py(df,'test.hdf5',key='events')print(read_h5py('test.hdf5',key='events'))plottingUtils for plotting data into a FACT camera view. Based on matplotlib.importmatplotlib.pyplotaspltfromfact.plottingimportcamerafromnumpy.randomimportnormal# create some pseudo data with shape (10, 1440):data=normal(30,5,(10,1440))camera(data[0])plt.show()There are also functions to get the camera_geometry from the delivered
source file:fromfact.plottingimportget_pixel_coordspixel_x,pixel_y=get_pixel_coords()factdbThis module containspeeweeModelsfor ourfactdataMySQL database.
These were automatically created bypeeweeand provide means to query this database in python without writing raw sql queries.For example, to get the total number of runs take by FACT you can do:fromfact.factdbimportconnect_database,RunInfoconnect_database()# this uses the credentials module if no config is givennum_runs=RunInfo.select().count()A few convenience functions are already implemented.
To get apandas.DataFramecontaining the observation time per source and runtype, you can do:fromfact.factdbimportconnect_database,get_ontime_per_source_and_runtypeconnect_database()num_runs=RunInfo.select().count()print(get_ontime_by_source_and_runtype())To download the database and read it to Pandas dataframe without using peewee:fromfactimportcredentialsimportpandasaspdfactDB=credentials.create_factdb_engine()runInfo=pd.read_sql_table(table_name="RunInfo",con=factDB)auxservicesUtilities to read in our aux fits files into pandas dataframes.fromfact.auxservicesimportMagicWeatherfromdatetimeimportdateweather=MagicWeather(auxdir='/fact/aux/')df=weather.read_date(date(2016,1,1))
Package: pyfactcast
PyFactCastWelcome to pyfactcast. You can find more extensive documentation over atreadthedocs.This project arose manly out of frustration with the excessive wait times for a spring boot
based CLI like the one offered by the originalFactCast.
But on the way grew a bit. It will likely grow even more as I would like to actually use this
tooling to bring the ability for rapid prototyping and production grade python applications
to the FactCast community.Contributions are welcome. Just get in touch.QuickstartSimplypip install pyfactcastand get going. The cli is available asfactcastand
you can runfactcast --helpto get up to speed on what you can do.DevelopmentThis project usespoetryfor dependency management andpre-commitfor local checks.
Package: py-factom-did
py-factom-didpy-factom-didis a Python library for working with DIDs on the Factom blockchain. It is an implementation
of theFactom DID method
specificationand consists of two main modules:factom_did.clientandfactom_did.resolver.Theclientmodule enables:creation of a new DIDaddition of management key(s) for the DIDaddition of DID key(s) for the DIDaddition of service(s) for the DIDexport of public metadata to be recorded on Factomencryption of the newly created keysupdate of an existing DID: adding/revoking management keys, DID keys and services and producing a signed DID
update entryupgrade of the method version of an existing DIDdeactivaiton of an existing DIDTheresolvermodule contains a pure-data library for re-constructing the effective DID Document from a list of DID
entries. It is a complete implementation of the resolver specification inhttps://github.com/bi-foundation/FIS/blob/feature/DID/FIS/DID.mdand contains an extensive unit test suite with 100% test coverage.ExamplesYou can find an example of the library workflow in theexamples/directory. In order to run the
example, please note that it is necessary to:have local instances offactomdandfactom-walletdrunningcreate an environment variable calledEC_ADDR, which contains a funded EC
address to pay the fees for recording the DID on-chainInstallationpip install py-factom-didDocumentationAPI documentation of the library is availablehereBuildClone the repoCreate the virtual environment and install the dependencies:pipenv installorpipenv install --pre -dto install both the default and development dependenciesActivate the virtual environment:pipenv shellExecute the tests:pytestExecute the example:python -m examples.example
Package: pyfactor
Welcome to the PyPI page ofPyfactor- a refactoring tool thatvisualisesPython source files, modules and importable packages as a graph of dependencies
between Python constructs like variables, functions and classes.$pyfactor--help$pyfactorscript.py$pyfactorscript.py--skip-external--viewVisit our online documentation onRead The Docsfor reference documentation, examples and release notes.
If you’ve found a bug or would like to propose a feature,
please submit an issue onGitHub.InstallationPyfactorcan be installed from the Package Index viapip.$pipinstallpyfactorAdditionally,Pyfactordepends on a free graph visualisation softwareGraphviz, available for Linux, Windows and Mac.
See also the documentation of theGraphviz Python packagefor more help.Release notesRelease notes can be found on ourRead The Docs site.
Package: pyfactorial
PyFactorialThis is a simple Python package for calculating factorials.InstallationYou can install PyFactorial usingpip:pipinstallpyfactorialUsageTo use thefactorialfunction in your Python code, first import it:frompyfactorial.moduleimportfactorialThen, you can calculate the factorial of a non-negative integer:result=factorial(5)print(f"The factorial of 5 is{result}")
Package: pyfactories
PyFactories🚀 Mock data generation for pydantic and dataclasses. 🚀Documentation:https://pyfactories.tarsild.io📚Source Code:https://github.com/tarsil/pyfactoriesMotivationPydantic Factorieswas initially created and used by a lot of people and it
is an extremely powerful package that was heavily tested by the same authors of Starlite, now,
Litestar. During their own evolution and development they felt the need to add more support to the
package that was no longer only pydantic and therefore they created thePolyfactoryand archived thePydantic Factories.PyFactories is a literal fork from the latest Pydantic Factories and aims to continue the same
work set by the previous creators with the difference that will be only maintaining the factories
for Pydantic and the upcoming Pydantic 2.0+.The team behind Pydantic Factories did a fantastic job and the credit goes to them whilePyFactoriescontinues its own fork path.If you aim to use something more than just Pydantic, it is strongly recommended to visitPolyfactoryand migrate to it and of course, leave them a ⭐️.In the meantime if you only want the Pydantic side of things, then you can usePyFactoriesin
the same fashion as its ancestor.InstallationpipinstallpyfactoriesMigrate from Pydantic FactoriesIt is actually straightforward, you simply need to replacepydantic_factorieswithpyfactoriesin your imports and that is it.Examplefromdatetimeimportdate,datetimefromtypingimportList,UnionfrompydanticimportUUID4,BaseModelfrompyfactoriesimportModelFactoryclassPerson(BaseModel):id:UUID4name:strhobbies:List[str]age:Union[float,int]birthday:Union[datetime,date]classPersonFactory(ModelFactory):__model__=Personresult=PersonFactory.build()And just its own ancestor, this is it. Almost no work, you are able to create mock data objects
that fits thePersonPydantic class model definition.This is possible because of the typing information available on the pydantic model and model-fields,
which are used as a source of truth for data generation.The factory parses the information stored in the pydantic model and generates a dictionary of kwargs
that are passed to thePersonclass'initmethod.FeaturesBeing initially the fork ofPydantic Factories, that also means:✅ Supports both built-in and pydantic types✅ Supports pydantic field constraints✅ Supports complex field types✅ Supports custom model fields✅ Supports dataclasses✅ Supports TypedDictsWhy This LibraryThis library was widely used before because of its powerfull features and therefore with the
upcoming Pydantic 2.0, it will be even more robust with the core done in Rust.💯 Powerful💯 Extensible💯 Simple💯 Rigorously testedContributingThis library is open to contributions.Please see the contribution guide!Star the initial authorsAlthough the intialPydantic Factoriesis no longer maintained, there is
always thePolyfactorythat deserves a ⭐️.
Package: py-factors
py_factorsA python package that gives the mathematical factors of a number fast.Installationpython3 -m pip install py_factorsExampleA quick example of methods you can access.Each of the functions below have additional argumentorderedexceptprime_factors.orderedcan take value ofTrueorFalse.Truemeans give an ordered output whileFalsemeans otherwise. By default it isFalsefrompy_factorsimportFactors#initialize the Factor classfactor_init=Factors()# factors of 200fact200=factor_init.math_factors(200)output:[1,200,2,100,4,50,5,40,8,25,10,20]#square factors of 200 i.e factors of 200 that are perfect squares.perf_fact200=factor_init.square_factor(200)output:[1,100,4,25]#even factors of 200even_fact200=factor_init.even_factors(200)output:[200,2,100,4,50,40,8,10,20]#odd factors of 200odd_fact200=factor_init.odd_factors(200)output:[1,5,25]# prime factors of 200 i.e factors of 200 that are prime numbersprime_fact200=factor_init.prime_factors(200)output:[2,5]Noteprime_factorsdoesn't have additional argumentorderedand it also gives result in ordered form.Settingordered=Falsein the functions gives result faster than whenordered=True.
Package: pyfactory
PyFactory is a library for writing generic model factories useful
for unit testing.ExampleBasic ExampleThe example below shows a very simple example. Say somewhere in our
tests we need various instances ofUserobjects. In our tests we
would simply write the following to create a user:user = UserFactory().create("basic")The PyFactory code necessary to make this happen is shown below. Note
that theModelBuildercreated would only have to be done once.from pyfactory import Factory, schema

import models

class ModelBuilder(object):
    """
    The model builder is responsible for knowing how to build
    and create models based on their attributes. This is what
    allows PyFactory to be completely model-agnostic.
    """

    @classmethod
    def build(cls, model_cls, attrs):
        return model_cls(attributes)

    @classmethod
    def create(cls, model_cls, attrs):
        result = cls.build(model_cls, attrs)
        result.save()
        return result

class UserFactory(Factory):
    """
    This shows a simple factory which creates a type of User.
    """

    _model = models.user.User
    _model_builder = ModelBuilder

    @schema()
    def basic(self):
        return {
            "first_name": "Test",
            "last_name": "User",
        }AssociationsIn any application, models typically have associations. Let’s look at
the case where we have aPostmodel which is written by aUser.
If we want a validPostobject in our tests, once again we only need
to do the following:post = PostFactory().create("basic")And the PyFactory factories to make this possible are equally simple:class PostFactory(Factory):
    @schema()
    def basic(self):
        return {
            "title": "Fake Title",
            "body": "Lorem ipsum...",
            "author_id": association(UserFactory(), "basic", "id")
        }Attribute OverridesGiven the above examples, what if you already had aUserthat you
wanted as a post author? Well, its simple to override attributes by
just passing the override attributes as additional keyword arguments
to the factory method:author = # Pretend we got an author somewhere
post = PostFactory().create("basic", author_id=author.id)
Package: pyfactxx
Python bindings for FaCT++ reasonerFaCT++ is a well-optimizedopen-sourcereasoner forSROIQ(D)description logic with simple datatypes (OWL 2), written in C++. FaCT++ was created in 2003-2015 byDmitry TsarkovandIan Horrocksin the University of Manchester, UK.This repository is thework in progressfor linking the FaCT++ with the Python'sRDFLibpackage. This repository is based on the works of Artur Wroblewskifactppandcoras. The goals are to create the RDFLib store with inference capabilities and to demonstrate the use of the FaCT++ API.Reasoner detailsThe FaCT++ implements theatomic decomposition algorithms(i.e.represents the ontologies as terse directed acyclic graphs). Atableaux decision procedureis applied forSROIQ(D)together with the set ofoptimisation heuristics, such as:lexical normalisation and simplification,synonym replacement,rewriting absorption,told cycle elimination,dependency-directed backtracking (backjumping),boolean constant propagation,semantic branching,ordering heuristics,model merging,completely defined concepts,clustering for wide and shallow taxonomies.To tackle the OWL 2 computational complexity (double exponential in time for the worst case), the FaCT++ presentspersistent and incremental reasoning. In the persistent mode, FaCT++ saves the inferred information together with its internal state into a file, which can be reloaded later with much less computational effort than reasoning would require. In the incremental mode, FaCT++ determines which parts of the precomputed inferences may be affected by an incoming change and only recomputes a subset of the inferences.The mentioned above allows to achieve a very good performance on such known ontologies asFHKB,SNOMED CT, andThesaurus.The FaCT++ supportsJava OWL-API, Lisp API, andDIG interface. It can also beused in C. There is also awork of Levin and Cowellon C++ usage (unmaintained).Installationpip install cython
cd FaCT++.Python
cmake .
make && make install(Sorry, no pip support currently!)UsageRun an example:python examples/imply-class.pyTry to load FOAF ontology:./bin/factpp-load ontologies/foaf.rdfand print ontology report:./bin/factpp-load ontologies/foaf.rdf 2>&1 | bin/factpp-load-reportAuthors of Python partArtur WroblewskiEvgeny BlokhinAndrey SobolevIvan RygaevLicenseKernel reasoner code: GNU LGPL 2.1Coras Python interface: GNU GPL 3.0
Package: pyfacy
This Package used for Face Recognition with Machine AlgorithmInstalling Steps for requirements python packageInstalling dlib on UbuntuThe following instructions were gathered on Ubuntu 16.04 but should work on newer versions of Ubuntu as well.To get started, let’s install our required dependencies:sudo apt-get update
sudo apt-get install build-essential cmake
sudo apt-get install libopenblas-dev liblapack-dev
sudo apt-get install libx11-dev libgtk-3-dev
sudo apt-get install python python-dev python-pip
sudo apt-get install python3 python3-dev python3-pipafterpip install dlibInstalling pyfacy models on Ubuntupip install pyfacy_dlib_modelsInstalling imutils on Ubuntupip install imutilsInstalling numpy, scipy and sklearnpip install numpy
pip install scipy
pip install scikit-learnExamples:Read Imagefrom pyfacy import utils
img = utils.load_image('<image src>')
ex:
img = utils.load_image('manivannan.jpg')Face Encodings:from pyfacy import utils
img = utils.load_image('<image src>')
encodings = utils.img_to_encodings(img)Compare Two facesfrom pyfacy import utils
image1 = utils.load_image('<image1 src>')
image2 = utils.load_image('<image2 src>')
matching,distance = utils.compare_faces(image1,image2)Note: The compare_faces return Boolean and Distance between two facesExample for Face Recognition using MLImplementing AlgorithmsKNN - K-Nearest NeighborsLOG_REG_BIN - Logistic Regression with two classesLOG_REG_MUL - Logistic Regression with more than two classesLDA - Linear Discriminant AnalysisTraining , Save model and Predict Imagefrom pyfacy import face_recog
from pyfacy import utils
mdl = face_recog.Face_Recog_Algorithm()
# Train the Model
# Implemented only four algorithms above mentioned and put the shortform
mdl.train('pyfacy/Test_DS',alg='LOG_REG_MUL')
# Save the Model
mdl.save_model()
# Predicting Image
img = utils.load_image('<image src>')
mdl.predict(img)Loading model and Predict Imagefrom pyfacy import face_recog
from pyfacy import utils
mdl = face_recog.Face_Recog_Algorithm()
# Load Model
mdl.load_model('model.pkl')
# Predicting Image
img = utils.load_image('<image src>')
mdl.predict(img)Face ClusteringCluster the image_srcfrom pyfacy import face_clust
# Create object for Cluster class with your source path(only contains jpg images)
mdl = face_clust.Face_Clust_Algorithm('./pyfacy/cluster')
# Load the faces to the algorithm
mdl.load_faces()
# Save the group of images to custom location(if the arg is empty store to current location)
mdl.save_faces('./pyfacy')
Package: pyf.aggregator
Python Package Filter AggregatorThe Python Package Filter Aggregator (pyf.aggregator) aggregates the meta
information of all Python packages in the PyPI.QuickstartFor detailed installation instructions, read thedocs.LicenseThe code is open-source and licensed under the Apache License 2.0.Credits@jensens@veit@guziel@pypaChangelog1.0.0 (unreleased)Nothing changed yet.
Package: pyfahrplan
pyfahrplanCLI application for CCC several fahrplan files (schedule.json), currently based on:https://raw.githubusercontent.com/voc/{32-36}C3_schedule/master/everything.schedule.jsonhttps://data.c3voc.de/rC3/everything.schedule.jsonhttps://data.c3voc.de/rC3_21/everything.schedule.jsonUsageUsage: pyfahrplan [OPTIONS]

Options:
  -c, --conference TEXT           CCC acronym (32c3 to 36c3 plus rc3 and
                                  rc3-2021) that you want to filter on, 'all'
                                  for all conferences
  -d, --day INTEGER               Day you want to filter [1-4] or 0 for all
                                  days.
  -r, --room TEXT                 Name of the room you want to filter [room
                                  names] or 'all' for all rooms
  -s, --speaker TEXT              Name of a speaker you want to search.
  -st, --start [%H:%M]            Start time of the talk(s) you want to
                                  search.
  -t, --title TEXT                A part of the title of the talk(s) you want
                                  to search.
  -tr, --track TEXT               A part of the track description you want to
                                  search.
  --reverse                       Reverse results
  --show-abstract                 Shows abstracts, default False
  --show-description              Shows descriptions, default False
  --sort [day|speakers|title|track|room|talk_start]
                                  Sort by
                                  day|speakers|title|track|room|talk_start
  --update-cache                  Delete the cache file and redownload all
                                  fahrplans
  --no-past                       Filter out talks that lay in the past
  --help                          Show this message and exit.DevelopmentClone this repository, then create a virtualenv, e.g., inside the repository:python3-mvenv.venv
pipinstallpoetry# if you don't have it globally installedpoetryinstall# install all dependencies, including dev dependenciespoetest# to run the testspytest--cov=pyfahrplantests/&&coveragehtml# to create a coverage report
Package: pyfairdesk
pyfairdeskpython wrapper of the Fairdesk APIFairdesk Sign upFairdesk Sign up ReferralInstall$ pip install pyfairdeskAPI UsageLoad Marketsofficial documentimport pyfairdesk

exchange = pyfairdesk.Fairdesk()
exchange.load_markets()fetch balancesimport pprint
import pyfairdesk

with open("../fairdesk.key", "r", encoding="utf-8") as f:
    lines = f.readlines()
    key = lines[0].strip()
    secret = lines[1].strip()

exchange = pyfairdesk.Fairdesk(key, secret)
resp = exchange.fetch_balance()
data = resp['data']
pprint.pprint(data)response{'accounts': [{'accountBalance': '463.56',
               'availBalance': '463.56',
               'bonus': '35.00',
               'currency': 'USDT',
               'display': 'Tether',
               'icon': 'https://sgtnstatic-1306519353.cos.ap-singapore.myqcloud.com/currency/USDT.png',
               'positionMargin': '0.00',
               'unRealizedPnL': '0.00'}],
 'marginBalanceBtc': '0.01149596',
 'marginBalanceUsd': '463.56',
 'totalAccountBalance': '463.56',
 'totalUnRealizedPnL': '0.00'}Margin mode and leverageimport pyfairdesk

with open("../fairdesk.key", "r", encoding="utf-8") as f:
    lines = f.readlines()
    key = lines[0].strip()
    secret = lines[1].strip()

exchange = pyfairdesk.Fairdesk(key, secret)
resp = exchange.fetch_symbol_config()
data = resp['data']
for symbol in data:
    print(symbol)response{'symbol': 'axsusdt', 'crossLeverage': 20, 'isolatedLeverage': 20, 'makerFeeRate': '0.00018', 'takerFeeRate': '0.00028'}
{'symbol': 'thetausdt', 'crossLeverage': 20, 'isolatedLeverage': 20, 'makerFeeRate': '0.00018', 'takerFeeRate': '0.00028'}
{'symbol': 'linkusdt', 'crossLeverage': 20, 'isolatedLeverage': 20, 'makerFeeRate': '0.00018', 'takerFeeRate': '0.00028'}
{'symbol': 'ftmusdt', 'crossLeverage': 20, 'isolatedLeverage': 20, 'makerFeeRate': '0.00018', 'takerFeeRate': '0.00028'}
{'symbol': 'xlmusdt', 'crossLeverage': 20, 'isolatedLeverage': 20, 'makerFeeRate': '0.00018', 'takerFeeRate': '0.00028'}
{'symbol': 'sushiusdt', 'crossLeverage': 20, 'isolatedLeverage': 20, 'makerFeeRate': '0.00018', 'takerFeeRate': '0.00028'}order
Package: pyfairsim
pyFairSIMpython version of the fast sim projectinstallrun:pip install pyfairsimsettingsAll settings and physical parameters are read from a json file.
To get an example file run python -m create_example_settings.py and change all the explaining texts to the values you need.run parameter estimationTo run a parameter estimation for a given sim-stack usepython -m pyfairsim.parameter_estimation -f <path-to-image> -s <path-to-settings> -o <path-to-save-settings>For help use python -m parameter_estimation.py -h. Settings and save settings path can be the same then the obtained values overwrite the old values.run reconstructionTo run a reconstruction for a given sim-stack usepython -m pyfairsim.reconstruction -f <path-to-image> -s <path-to-settings> -o <path-to-save-reconstructed-image>For help use python -m reconstruction.py -hrun batch reconstructionRuns a parameter estimation and then a reconstruction on all .tiff/.tif files in given folder and all subfolders.
Command:python -m pyfairsim.batch_reconstructionrun absolute phase estimationRuns a non-iterative phase estimation based on auto-correlation by Wicker et al. For it to work parameter estimation needs to be executed first.python -m pyfairsim.phase_estimation -f <path-to-image> -s <path-to-settings> -o <path-to-save-settings>run tiled reconstructionATTENTION still in development!!! Tile size should be an even number, only supports square images with sizes divisible by the tile size. Overlap of the tiles for now is hard coded to be half of the tile size. Before running this a parameter estimation and phase estimation needs to be run. Tiled reconstruction will use absolute phase estimation for the tiles.python -m pyfairsim.tiled_reconstruction -f <path-to-image> -s <path-to-settings> -o <path-to-save-reconstructed-image>