Saravanan666/pypi-org huggingface dataset:
Package: pyfin-sentiment
pyFin-SentimentA library for sentiment analysis of financial social media postsSentiment Analysis of Financial Social Media PostsThis library can help youextract market sentiment from short social media posts. Trained on data from Twitter, it can classify sentimetn intothree classes: Bullish, Bearish, Neutral/No Sentiment.
Note that we need to differentiate between market sentiment and general sentiment. Consider this example:💬 Nice, already made loads of money this morning and now im shorting $AAPL, let's goooo!While the general sentiment in the text is positve, themarket sentimentis negative as the author is shorting a stock.
Therefore, ...If you are looking for a generic sentiment model that works well on social media content, take a look atVADERorTwitterRoBERTaIf you are looking for a sentiment analysis models that excels on new headlines sentiment analysis, check outFinBERTOtherwise, stay here 🙃Documentation📚 The documentation lives onpyfin-sentiment.readthedocs.ioExamplefrompyfin_sentiment.modelimportSentimentModel# the model only needs to be downloaded onceSentimentModel.download("small")model=SentimentModel("small")model.predict(["Long $TSLA!!","Selling my $AAPL position"])# array(['1', '3'], dtype=object)We use the following conventions for mapping sentiment classes:Class NameMeaning1Positive, Bullish2Neutral, Uncertain3Negative, Bearish
Package: pyfin-trading
Package for analyzing and visualizing financial time-series dataDeveloped by Poonam Deshmukh (c) 2023.Requirementspyfin_tradingwould need the following libraries to be installedpandasnumpyyfinancedatetimeInstallationYou can install it via pip:pipinstallpyfin-tradingModulesstock_datastatsindicators1. stock_dataThis module majorly helps with getting stock data and can be accessed as follows:frompyfin_tradingimportstock_dataassddf=sd.get_data(ticker,start_date,end_date,interval)- Input ticker symbol along with its corresponding exchange.- Format for start_date & end_date must be "%Y-%m-%d"- By default end_date is set to today- Interval can take values like "1m", "2m", "5m", "15m", "30m", "60m", "90m", "1h", "1d", "5d", "1wk", "1mo", "3mo"where m = minute, h = hour, d = day, wk = week, mo = month- By default interval is set to "1d"Exampledf=sd.get_data("ITC.NS","2023-11-06")This will return ITC's data from NSE spanning from 6th Nov 2023 to present day with interval set to daily2. statsIt helps with calculating returns as well as some financial ratios:frompyfin_tradingimportstatsasstreturns=st.calculate_returns(df)# Calculates Daily & Cumulative Returnsst.beta(df,market,interval)st.volatility(df,trading_days=252)# Calculates SD & Annualized Volatilityst.sharpe(df,risk,trading_days=252)# Sharpe Ratiost.sortino(df,risk,trading_days=252)# Sortino Ratiost.alpha(df,market,interval,beta,risk)st.treynor(df,beta,risk,trading_days=252)# Treynor Ratiost.info(df,market,interval,risk,trading_days=252)# Information Ratio- By default Nifty 50 is used as a proxy for the market i.e. "^NSEI"3. indicatorsFor calculating technical indicators:frompyfin_tradingimportindicatorsasptpt.sma(df,sma_period=15)pt.ema(df,ema_period=15,adjust=False)pt.rsi(df,rsi_period=14)pt.connors_rsi(df,rsi_period=14,updown_length=2)pt.stoch(df,k=14,d=3)# Stochastic Oscillatorpt.bollinger_bands(df,sma_period=20,std_dev=2)# Bollinger Bandspt.aroon(df,aroon_period=25)# Aroon Oscillatorpt.macd(df,short_period=12,long_period=26,signal=9,adjust=False)# Moving Average Convergence Divergencept.ichimoku_cloud(df,conversion=9,base=26,lead_b=52)# Ichimoku Cloud
Package: py-finvoice
Python module for generating Finvoice invoices.Finvoice message can be used for invoicing and for other business messages, such as quotations, orders, order confirmations, price lists, etc. Due to easy adoption, it is suitable for invoicing between companies of all sizes and for consumer invoicing.This Python module is based on the XSDs released by the Federation of Financial Services, Finland.Seehttps://github.com/codemasteroy/py-finvoice/blob/master/README.md
Package: pyfir
AboutProvides utilities to convert WSGI environ/output to HTTP Request/Response. The main use case for this package is WSGI APP testing through its WSGI client.Installpip install pyfirHow to test your WSGI APPBasic exampletest_api.pyfrom fir.wsgi import Client
from fir.http import Request
from <package.module> import app # for example your Flask APP


# Create a WSGI Client
client = Client(app)


def test_api():
	# Use the client to perform request to your APP
	res = client.request(Request(
		method="GET",
		uri="/customers"
	))
	assert res.status_code == 200
	assert res.get_json() == [{"name":"john", "surname": "doe"}]Example of data driven teststest_api.pyimport unittest
from ddt import ddt, file_data
from fir.wsgi import Client
from fir.http import Request
from <package.module> import app # for example your Flask APP


# Create a WSGI Client
client = Client(app)


@ddt
class WSGITestCase(unittest.TestCase):

	@file_data('data.yaml')
	def test_api(self, request, response):
		global client
		res = client.request(Request(**request))
		assert res.status_code == response.get("status")
		if res.headers.get("content-type") == "application/json":
			assert res.get_json() == response.get("json")data.yaml- request:
	method: GET
	uri: /customers
  response:
	status: 200
	json:
	- name: jhon
	  surname: doe

- request:
	method: GET
	uri: /customers/mark
  response:
	status: 404Unit testpip install -r test-requirements.txt
python -m pytest tests/ --cov=fir
Package: py-firebase-dynamic-links
Firebase Dynamic Links python clientSimple python client to generateFirebase Dynamic Links. It allows to
use a custom domain and fields for generate links for android and ios.RequirementsPython >= 3.4PIPAPI Key fromFirebase console Settings page.Installationpipinstallpy-firebase-dynamic-linksUsagefromfirebase_dynamic_linksimportDynamicLinksapi_key='your_api_key'domain='example.page.link'timeout=10dl=DynamicLinks(api_key,domain,timeout)# or DynamicLinks(api_key, domain)params={"androidInfo":{"androidPackageName":'packagename',"androidFallbackLink":'fallbacklink',"androidMinPackageVersionCode":'1'},}# dl.generate_dynamic_link(url_to_redirect, create_short_url, params) or# dl.generate_dynamic_link(url_to_redirect)short_link=dl.generate_dynamic_link('http://google.es',True,params)#https://example.page.link/h77capi_key:Key from firebase consoledomain: Domain uri prefix created in firebase console. For exampleexample.page.linkor your custom domain.timeout: Timeout for the api callparams: Dictionary of optional params. For example:{"androidInfo":{"androidPackageName":string,"androidFallbackLink":string,"androidMinPackageVersionCode":string},"iosInfo":{"iosBundleId":string,"iosFallbackLink":string,"iosCustomScheme":string,"iosIpadFallbackLink":string,"iosIpadBundleId":string,"iosAppStoreId":string}}More params available hereReferencehttps://firebase.google.com/docs/dynamic-links/resthttps://firebase.google.com/docs/reference/dynamic-links/link-shortener
Package: pyfirebasehandler
Certainly! Here's an exampleREADME.mdfile for your module:# pyfirebasehandler[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)

Your Module is a Python module for handling a Firebase database using the`firebase-admin`library.## InstallationYou can install Your Module using pip:

```shell
pip install pyfirebasehandlerMake sure you have thefirebase-adminlibrary installed as well.Usagefrompyfirebasehandler.firebase_handlerimportFirebaseHandler# Initialize FirebaseHandler with credentialshandler=FirebaseHandler('path/to/credentials.json')# Create a documentdata={'name':'John Doe','age':30}document_id=handler.create_document('users',data)## for creating a document with a custom referencedocument_id=handler.create_document('users',data,custom_ref="id01")print(f"Created document with ID:{document_id}")# Retrieve a documentdocument_data=handler.get_document('users',document_id)print(f"Retrieved document data:{document_data}")# Retrive list of documents from a collectioncollection_data=handler.read_collection('users')print(f"Retrieved list of collection data:{document_data}")# Update a documentupdated_data={'age':31}handler.update_document('users',document_id,updated_data)print("Document updated successfully")# Delete a documenthandler.delete_document('users',document_id)print("Document deleted successfully")Replace'path/to/credentials.json'with the actual path to your Firebase service account credentials JSON file.TestsTo run the tests for Module, execute the following command:python-munittesttests.test_firebase_handlerMake sure you have the necessary test credentials for your Firebase database.LicenseThis project is licensed under the terms of the MIT License. See theLICENSEfile for details.MIT License

Copyright (c) 2023 pyfirebasehandler

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Package: pyfirebasestockscli
pyfirebasestockscliportfolio+ command line interface for firebase operations.installpipinstallpyfirebasestockscliquick startExport the following environment variables:exportDATABASE_URL=https://<name>.firebaseio.comexportCRED_JSON=/path/to/firebase_sdk.jsonexportDATA_ROOT=/path/to/strategiesCreate database and delete existing:stocks-cUpdate prices and filter:stocks-uUpdate prices:stocks-pCreate strategies:stocks-sissue trackerhttps://github.com/portfolioplus/pyfirebasestockscli/issuese
Package: pyfirebird
IndexInstallFirebird ConsoleConfigurations~/.firebird/config~/.kube/config~/.oci/configEnvironment VariablesCONSOLE_URI_BASECSRF_TRUSTED_ORIGINSInitialize Firebird Console DatabaseStart Firebird ConsoleCommon CommandsRegister PipelineUnregister a PipelineStart a PipelineStop a PipelineList PipelinesInstallpipinstallpyfirebirdFirebird ConsoleIt provides a Web UI for pipeline management.Configurations~/.firebird/configThis file contains configuration for mysql, rabbitmq and zookeeper. Here is an example:{
    "zookeeper": {
        "hosts":     "zookeeper:2181"
    },
    "rabbitmq": {
        "username":  "stonezhong",
        "password":  "changeme",
        "host":      "rabbitmq",
        "port":      5672,
        "heartbeat": 300
    },
    "mysql": {
        "db_name":  "firebird",
        "username": "stonezhong",
        "password": "changeme",
        "server":   "10.2.0.29"
    }
}~/.kube/configThis is your kubernete config file. Firebird Console need to talk to kubernete clsuter to start, stop pipelines.~/.oci/configThis is needed if you are using Kubernete in Oracle Cloud Infrastructure. It is your oci config file. You may also need the key file referenced by this config file.Environment VariablesCONSOLE_URI_BASEfirebird console will read this variable and assuming this is the base url for firebird console. It is commonly used if you put firebird console behind a reverse proxy under certain path.# ExampleexportCONSOLE_URI_BASE=/streaming/consoleCSRF_TRUSTED_ORIGINSIt firebird console uses SSL, you need to specify the domain so HTTP post request won't be rejected due to CRRF trust issue.# ExampleexportCSRF_TRUSTED_ORIGINS=https://myserver.comInitialize Firebird Console DatabasefbconsolemigrateStart Firebird Consolefbconsolerunserver<ip>:<port># Example:fbconsolerunserver0.0.0.0:8000# You can access firebird console at $CONSOLE_URI_BASE/ui/Common commandsRegister a Pipelinepipelineregister\--pipeline-module-name<pipelinename>\--pipeline-namespace-name<pipelinenamespacename>\--pipeline-image-name<pipelineimagename># examplepipelineregister\--pipeline-module-namepipe\--pipeline-namespace-namefirebird\--pipeline-image-nameiad.ocir.io/idrnu3akjpv5/firebird-app1Unregister a Pipelinepipelineunregister-pid<pipelinename>Start a Pipelinepipelinestart-pid<pipelinename>Stop a Pipelinepipelinestop-pid<pipelinename>List Pipelinespipelinelist
Package: pyfirebirdsql
pyfirebirdsql package is a set of Firebird RDBMS bindings for Python.It is implemented using ctypes and allows connection to the database by Classic Firebird Server or through the Embedded Firebird Serverconnection via the Classic Firebird Server:import pyfirebirdsql
conn = pyfirebirdsql.connect(dsn='localhost:database.fdb', user='sysdba', password='***')
cur = conn.cursor()
cur.execute("select * from table")
for row in cur.fetchall():
    print(row)connection via the Embedded Firebird Server:import pyfirebirdsql
conn = pyfirebirdsql.connect(dsn='localhost:database.fdb', user='sysdba', password='***', embedded=True)
cur = conn.cursor()
cur.execute("select * from table")
for row in cur.fetchall():
    print(row)
Package: pyfirecrest
PyFirecRESTThis is a simple python wrapper for theFirecREST API.How to installThroughPyPI:python3 -m pip install pyfirecrestHow to use it as a python packageThe full documentation of pyFirecREST is inthis pagebut you can get an idea from the following example.
This is how you can use the testbuild from the demo environmenthere.
The configuration corresponds to the accountfirecrest-sample.importfirecrestasf7t# Configuration parameters for the Authorization Objectclient_id="firecrest-sample"client_secret="b391e177-fa50-4987-beaf-e6d33ca93571"token_uri="http://localhost:8080/auth/realms/kcrealm/protocol/openid-connect/token"# Create an authorization object with Client Credentials authorization grantkeycloak=f7t.ClientCredentialsAuth(client_id,client_secret,token_uri)# Setup the client for the specific accountclient=f7t.Firecrest(firecrest_url="http://localhost:8000",authorization=keycloak)try:parameters=client.parameters()print(f"Firecrest parameters:{parameters}")exceptf7t.FirecrestExceptionase:# When the error comes from the responses to a firecrest request you will get a# `FirecrestException` and from this you can examine the http responses yourself# through the `responses` propertyprint(e)print(e.responses)exceptExceptionase:# You might also get regular exceptions in some cases. For example when you are# trying to upload a file that doesn't exist in your local filesystem.passHow to use it from the terminalAfter version 1.3.0 pyFirecREST comes together with a CLI but for now it can only be used with thef7t.ClientCredentialsAuthauthentication class.Assuming you are using the same client, you can start by setting as environment variables:exportFIRECREST_CLIENT_ID=firecrest-sampleexportFIRECREST_CLIENT_SECRET=b391e177-fa50-4987-beaf-e6d33ca93571exportFIRECREST_URL=http://localhost:8000exportAUTH_TOKEN_URL=http://localhost:8080/auth/realms/kcrealm/protocol/openid-connect/tokenAfter that you can explore the capabilities of the CLI with the--helpoption:firecrest--help
firecrestls--help
firecrestsubmit--help
firecrestupload--help
firecrestdownload--help
firecrestsubmit-template--helpSome basic examples:# Get the parameters of different microservices of FirecRESTfirecrestparameters# Get the available systemsfirecrestsystems# Set the environment variable to specify the name of the systemexportFIRECREST_SYSTEM="cluster"# List files of directoryfirecrestls/home# Submit a jobfirecrestsubmitscript.sh# Upload a "small" file (you can check the maximum size in `UTILITIES_MAX_FILE_SIZE` from the `parameters` command)firecrestupload--type=directlocal_file.txt/path/to/cluster/fs# Upload a "large" filefirecrestupload--type=externallocal_file.txt/path/to/cluster/fs# You will have to finish the upload with a second command that will be given in the output
Package: pyfiredb
AlegraPyAgiliza las consultas a la base de datos utilizando la librería "Pyrebase". Pyrebase es una biblioteca de Python que proporciona una interfaz para interactuar con Firebase, una plataforma de desarrollo de aplicaciones web y móviles.CaracterísticasPermite actualizar, leer, buscar el máximo, buscar entre, buscarInstalación y usoInstalaciónpip install pyfiredbUsoUn ejemplo para usar este paquete, la configuración de firebase y credenciales de acceso se han tomado desde las variables de entornofrompyfiredbimportCredentialsfrompyfiredbimportDatabasefrompyfiredbimportSessiondefrun():fire=Session(Credentials.user,Credentials.password)firebase=Database(fire)print(firebase.equal("alegra/products","reference","TP-19100"))print(firebase.get("woocommerce/products"))invoices=firebase.between("alegra/invoices","date","2023-05-01","2023-05-1")print(invoices[1])if__name__=="__main__":run()CréditosCamilo Andrés Rodriguezreferenciashttps://developer.alegra.com/LicenciaEste proyecto está bajo la Licencia [MIT].¡Puedes personalizarlo según las necesidades específicas de tu proyecto!
Package: pyfiri
pyFIRI is a Python3 implementation of the FIRI-2018 (Faraday‐International
Reference Ionosphere), a semi-empirical D-Region model of the non-auroral
Earth’s ionosphere. Previous version of the FIRI (FT-2001) is incorporated
into a well-known mature International Reference Ionosphere (IRI,https://iri.gsfc.nasa.gov/)
model.If you use FIRI-2018 or pyFIRI directly or indirectly, please, cite in your research
the following TWO papers:1. Friedrich, M., Pock, C., & Torkar, K. (2018). FIRI‐2018, an updated empirical model
of the lower ionosphere. Journal of Geophysical Research: Space Physics, 123, 6737– 6751.https://doi.org/10.1029/2018JA0254372. Zolotov, O., Romanovskaya, Yu, & Knyazeva, M. (2021). pyFIRI - A free and open source
Python software package of the non-auroral Earth’s lower ionosphere. SoftwareX., 16, 100885.https://doi.org/10.1016/j.softx.2021.100885pyFIRI provides a thin Python3 wrapper around the tabulated electron density Ne profiles supplied
together with the research paper by Friedrich et al.(2018,https://doi.org/10.1029/2018JA025437).
For internal data representation, selection, and interpolation pyFIRI relies on xarray.DataArray
(https://xarray.pydata.org/) facilities.
Package: pyFirmata
pyFirmata is a Python interface for theFirmataprotocol. It is fully
compatible with Firmata 2.1, and has some functionality of version 2.2. It runs
on Python 2.7, 3.3 and 3.4.Test & coverage status:InstallationThe preferred way to install is withpip:pip install pyfirmataYou can also install from source withpython setup.py install. You will
need to havesetuptoolsinstalled:git clone https://github.com/tino/pyFirmata
cd pyFirmata
python setup.py installUsageBasic usage:>>> from pyfirmata import Arduino, util
>>> board = Arduino('/dev/tty.usbserial-A6008rIF')
>>> board.digital[13].write(1)To use analog ports, it is probably handy to start an iterator thread.
Otherwise the board will keep sending data to your serial, until it overflows:>>> it = util.Iterator(board)
>>> it.start()
>>> board.analog[0].enable_reporting()
>>> board.analog[0].read()
0.661440304938If you use a pin more often, it can be worth it to use theget_pinmethod
of the board. It let’s you specify what pin you need by a string, composed of
‘a’ or ‘d’ (depending on wether you need an analog or digital pin), the pin
number, and the mode (‘i’ for input, ‘o’ for output, ‘p’ for pwm). All
seperated by:. Eg.a:0:ifor analog 0 as input ord:3:pfor
digital pin 3 as pwm.:>>> analog_0 = board.get_pin('a:0:i')
>>> analog_0.read()
0.661440304938
>>> pin3 = board.get_pin('d:3:p')
>>> pin3.write(0.6)Board layoutIf you want to use a board with a different layout than the standard Arduino
or the Arduino Mega (for which there exist the shortcut classespyfirmata.Arduinoandpyfirmata.ArduinoMega), instantiate the Board
class with a dictionary as thelayoutargument. This is the layout dict
for the Mega for example:>>> mega = {
...         'digital' : tuple(x for x in range(54)),
...         'analog' : tuple(x for x in range(16)),
...         'pwm' : tuple(x for x in range(2,14)),
...         'use_ports' : True,
...         'disabled' : (0, 1, 14, 15) # Rx, Tx, Crystal
...         }TodoThe next things on my list are to implement the new protocol changes in
firmata:Pin State Query, which allows it to populate on-screen controls with an
accurate representation of the hardware’s configuration
(http://firmata.org/wiki/Proposals#Pin_State_Query_.28added_in_version_2.2.29)
Package: pyFirmata2
PyFirmata2 turns your Arduino into a data acquisition card controlled by Python.Up to 1kHz precise sampling at the analogue ports for digital filtering.Just upload the default firmata sketch into your Arduino and you are all set.pyFirmata2 is an updated version of pyFirmata whichreplaces loops
with callbacks. Instead of unreliable “sleep” commands in a loop the
Python application registers callbacks which are then called every
time after new data has arrived. This means for the analogue
channels the callbacks are called at the specified sampling rate
while the digital ports call the callback functions after
a state change at the port (from 0 to 1 or 1 to 0).This API has been used in my Digital Signal Processing (DSP) class to
practise realtime filtering of analogue sensor
data. Examples can be viewed on the YouTube channel of the
class:https://www.youtube.com/user/DSPcourseInstallationUpload firmataInstall the Arduino IDE on your computer:https://www.arduino.cc/en/Main/SoftwareStart the IDE and upload the standard firmata sketch into your Arduino with:File -> Examples -> Firmata -> Standard FirmataInstall pyfirmata2The preferred way to install is withpip/pip3. Under Linux:pip3 install pyfirmata2 [--user] [--upgrade]and under Windows/Mac type:pip install pyfirmata2 [--user] [--upgrade]You can also install from source with:git clone https://github.com/berndporr/pyFirmata2
cd pyFirmata2Under Linux type:python3 setup.py installUnder Windows / Mac:python setup.py installUsagePlease go tohttps://github.com/berndporr/pyFirmata2for the
documentation and in particular the example code.Example codeIt’s strongly recommended to check out the example code athttps://github.com/berndporr/pyFirmata2/tree/master/examplesto see how the callbacks work.CreditsThe original pyFirmata was written by Tino de Bruijn.
The realtime sampling / callback has been added by Bernd Porr.
Package: pyfiscal
Calculation of tax data in MéxicoFeatures
[x] Support for Python 2.7-3.8InstallationInstall pyfiscal.pipinstallpyfiscalCURPThe Clave Única de Registro de Población (CURP) is a unique 18 character alphanumeric identity code for both Mexican residents and citizens.RFCThe Federal Taxpayer Registry is a code used in Mexico to distinguish each individual or company required to pay taxes. The people or organizations that have their RFC are called contributors.1.- Physical person:This homoclave will be designated by the SAT, reviewing the request through already designated official paper.NSSThe Social Security Number (NSS) is unique, permanent and nontransferable and is assigned to keep a record of workers and insured.Validation:Only 11 digits will be validated.Validation by the Luhn algorithm.Calculate the last digit.Unit Testspython-munittesttests/data_fiscal_test.pypython-munittesttests/validator_test.pyLicenseSee LICENSE for more details (The MIT License).Referenceshttps://es.wikipedia.org/wiki/Algoritmo_de_Luhn