Saravanan666/pypi-org huggingface dataset:
Package: saleor-social-auth
social_authSocial auth plugin (wx, alipay & etc.) for SaleorMore details will come as the development goes on...Plugin Configuration Demosocial_strategy:social_auth.strategy.SaleorPluginStrategysocial_storage:social_django.models.DjangoStoragedefault_backend:google-openidconnectsocial_auth_config:# yaml strings, see below# social_auth_config content demo# https://www.cloudbees.com/blog/yaml-tutorial-everything-you-need-get-startedSOCIAL_AUTH_AUTHENTICATION_BACKENDS:-social_core.backends.google_openidconnect.GoogleOpenIdConnect-social_auth.backends.weapp.WeappAuthSOCIAL_AUTH_GOOGLE_OPENIDCONNECT_KEY:xxxyyyzzz.apps.googleusercontent.comSOCIAL_AUTH_GOOGLE_OPENIDCONNECT_SECRET:YOUR_GOIDC_SECRETSOCIAL_AUTH_WEIXIN_WEAPP_KEY:wxaaabbbcccdddeeeSOCIAL_AUTH_WEIXIN_WEAPP_SECRET:YOUR_WEAPP_SECRETEnv Props# before `python manage.py migrate`exportSOCIAL_AUTH_DB_INIT=true# it may trigger `migrate` twice, but it's acceptable...pythonmanage.pymigrateunsetSOCIAL_AUTH_DB_INIT# you can run any django command without the extra(time-consuming) db init stuff of this plugin from now onpythonmanage.pyrunserver
Package: sales-analysis
sales_analysis: web application to view sales dataWhat is it?sales_analysis is a lightweight tool for viewig sales data in web browser.Note: The input data must be in the same format, as the.csvfiles insales_analysis/data_pipeline/dataWhere to get it?The package can be installed by runningpip install sales_analysisDependanciesPandasFlaskpytestLicenseBSD 3How to run the appAfter successfully installingsales_analysis. The app may be run without any modification tosales_analysis/data_pipeline/data. However, this will execute the sample data provided. In order to change the default behaviour, the data insales_analysis/data_pipeline/datamust be replaced with new data.Note: It is imperative that this folder contains data formatted in the same way as provided.Once the data has been imported, then follow the steps below.Open a terminal and enterpythonto launch an interactive python session.> python
Python 3.7.7 (default, Mar 23 2020, 16:19:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>Then enter the following>>> from sales_analysis import sales_app
>>> app.run()This will output the following.* Serving Flask app "sales_analysis" (lazy loading)
* Environment: production
  WARNING: This is a development server. Do not use it in a production deployment.
  Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)Then copy and pastehttp://127.0.0.1:5000/into a browser. The default page will return the message belowNot FoundThe requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.Add a valid date to the url. For example, add2019-08-02to the url i.e.http://127.0.0.1:5000/2019-08-02. This will output the following in the browser.{"customers":10.0,"discount_rate_avg":0.12950211356271726,"items":3082.0,"order_total_avg":1341449.559055637,"total_discount_amount":20061245.64408109}If an incorrectly formatted date is passed, the server will raise an error. For example, if2019-08is passed, the following error is raised.ValueError: time data '2019-08' does not match format '%Y-%m-%d'
Package: salesea
salesea@nginx-log-parser开始使用网络姻缘一线牵 珍惜这段缘Nginx要求Nginx http配置：日志格式log_formatsalesea'$remote_addr-$remote_user[$time_local]"$request"''$status$body_bytes_sent"$http_referer"''"$http_user_agent""$http_x_forwarded_for"';Nginx server配置：日志路径access_log/to/path/access.logsalesea;Python要求Python版本：3.6+salesea.row配置文件[nginx]server_name=需要采集的nginx server_name，可以使用*通配符nginx_path=如果你配置了环境变量，可以为空[request]concurrency=上传日志并发数[salesea]visit_apikey=salesea的apikeyinterval=采集间隔，单位秒安装python3-mpipinstallsalesea-ihttps://pypi.org/simple运行# 生成配置文件$salesea-g$请输入域名(可选):*.example.io
$请输入访问密钥(必填):***********************
$请输入日志扫描间隔(默认60秒):$配置文件已生成:salesea.row# 运行$salesea-s# or$salesea-s-csalesea.row# debug mode$salesea-s-d# or$salesea-s--debug
Package: salesfly
A Python library for the Salesfly API.SetupYou can install this package by using the pip tool and installing:$ pip install salesflyOr:$ easy_install salesflySetting up a Salesfly API accountSign up for Salesfly athttps://salesfly.comUsing the Salesfly APIDocumentation for the Python client can be found alongside the other API clients here:https://docs.salesfly.com/python/
Package: salesforce-bulk-python
Salesforce Bulk PythonSalesforce Bulk Python is a Python library for using the Salesforce REST Bulk API v2.0. It is especially designed to handle big-data worksloads, in which all data from Salesforce should be extraced.It makes uses of asyncio for parallel execution. And is easily exendable by writing your ownBulkAPIResultHandler.How to use1. AuthenticationThis library currently only supports theOAuth 2.0 JWT Bearer Flow.connection_settings=BulkAPIConnectionSettings(private_key=<KEYHERE>,# Private key to encode the JWT with (used by jwt.encode())consumer_key=<CONSUMERKEYHERE>,# Consumer Key Created by Connected Appaudience=<SALESFORCEDOMAIN>,# Example: https://test.salesforce.comusername=<USERNAME>,# User that is assigned to the appapi_version=<APIVERSION># Example: v52.0)2. Create a connectionCreate a connection by passingBulkAPIConnectionSettingsinto aBulkAPIConnection.con=BulkAPIConnection(connection_settings)3. Get a reference to an Salesforce object# Get one objectobj=SalesforceObject('Account',con)# or... get a List[SalesforceObject] from all objects that are compatible with the Bulk API v2.0all_obj=list([SalesforceObject(x,con)forxincon.get_all_objects()])4. Create anBulkAPIResultHandlerand implement thehandlemethod.TheBulkAPIResultHandlerwill do something with the responses from the Bulk API.For example, we could write the responses to a Azure ADLS Gen2 Storage account:classADLSHandler(BulkAPIResultHandler):defhandle(self,data):datetime_start=datetime.now()file_name=f'/salesforce/{self.job.object.name}/timestamp={datetime_start}/{self.batch_number}.csv'adls.raw.client.create_file(filename).upload_data(data.content,overwrite=True)5. Create a job and register the handlerWe currently only support theGetAllBulkAPIJobbut you can subclass theBulkAPIJobyourself and implement a customquerymethod.# create a jobjob1=GetAllBulkAPIJob(obj,con)job1.on_complete.append(ADLSHandler)job2=GetAllBulkAPIJob(obj,con)job2.on_complete.append(ADLSHandler)6. Execute one single job, or run multiple jobs in parralel.# Run only one jobasyncio.run(job.start())# Run multiple jobs in parralelq=JobQueue(parallel_jobs=10)q.extend([job1,job2])asyncio.run(q.run_all())When the jobs above are executed, the results will be passed to the handler.
Package: salesforce-bulk-yplan
Python client library for accessing the asynchronous Salesforce.com Bulk
API.Installationpipinstallsalesforce-bulk-yplanAuthenticationTo access the Bulk API you need to authenticate a user into Salesforce.
The easiest way to do this is just to supplyusernameandpassword. This library will use thesalesforce-oauth-requestpackage (which you must install) to run the Salesforce OAUTH2 Web flow
and return an access token.fromsalesforce_bulkimportSalesforceBulkbulk=SalesforceBulk(username=username,password=password)Alternatively if you run have access to a session ID and instance_url
you can use those directly:fromurlparseimporturlparsefromsalesforce_bulkimportSalesforceBulkbulk=SalesforceBulk(sessionId=sessionId,host=urlparse(instance_url).hostname)OperationsThe basic sequence for driving the Bulk API is:Create a new jobAdd one or more batches to the jobWait for each batch to finishClose the jobBulk QuerySalesforceBulk.create_query_job(object_name,contentType='CSV',concurrency=None)Examplejob=bulk.create_query_job("Contact",contentType='CSV')batch=bulk.query(job,"select Id,LastName from Contact")whilenotbulk.is_batch_done(job,batch):sleep(10)bulk.close_job(job)>>>forrowinbulk.get_batch_result_iter(job,batch,parse_csv=True):...printrow#row is a dictBulk Insert, Update, DeleteAll Bulk upload operations work the same. You set the operation when you
create the job. Then you submit one or more documents that specify
records with columns to insert/update/delete. When deleting you should
only submit the Id for each record.For efficiency you should use thepost_bulk_batchmethod to post
each batch of data. (Note that a batch can have a maximum 10,000 records
and be 1GB in size.) You pass a generator or iterator into this function
and it will stream data via POST to Salesforce. For help sending CSV
formatted data you can use the salesforce_bulk.CsvDictsAdapter class.
It takes an iterator returning dictionaries and returns an iterator
which produces CSV data.Full example:fromsalesforce_bulkimportCsvDictsAdapterjob=bulk.create_insert_job("Account",contentType='CSV')accounts=[dict(Name="Account%d"%idx)foridxinxrange(5)]csv_iter=CsvDictsAdapter(iter(accounts))batch=bulk.post_bulk_batch(job,csv_iter)bulk.wait_for_batch(job,batch)bulk.close_job(job)print"Done. Accounts uploaded."Concurrency modeWhen creating the job, passconcurrency=Serialorconcurrency=Parallelto set the concurrency mode for the job.History1.2.1 (2016-07-15)Removesalesforce-oauth-request-yplanas a hard requirement insetup.py(to closer match the original).1.2.0 (2016-07-14)Brought backHISTORY.rst.Python2 and Python3 compatibility.Forkedsalesforce-bulk-yplanpackage.Depends onsalesforce-oauth-request-yplanfrom now on.
Package: salesforce-cdp-connector
salesforce-cdp-connectorA readonly CDP client for Python. This can be used to execute queries against CDP and load the data into python.UsageInstallationInstall the package from Pypi using the commandpip install salesforce-cdp-connectorQuick StartWe have to create an instance of the SalesforceCDPConnection to connect to CDP.The object can be created as follows:Using Username and Passwordfrom salesforcecdpconnector.connection import SalesforceCDPConnection
conn = SalesforceCDPConnection(
        'login_url', 
        'user_name', 
        'password', 
        'client_id', 
        'client_secret'
    )Using OAuth Tokensfrom salesforcecdpconnector.connection import SalesforceCDPConnection
conn = SalesforceCDPConnection(login_url, 
       client_id='<client_id>', 
       client_secret='<client_secret>', 
       core_token='<core token>'
       refresh_token='<refresh_token>'
   )Once the connection object is created the queries can be executed using cursor as followscur = conn.cursor()
cur.execute('<query>')
results = cur.fetchall()The query results can also be directly extracted as a pandas dataframedataframe = conn.get_pandas_dataframe('<query>')Creating a connected AppLog in to salesforce as an admin. In the top right corner, click on the gear icon and go to stepIn the left hand side, under Platform Tools, go to Apps > App ManagerClick on New Connected AppFill in the required Basic Information fields.Under API (Enable OAuth Settings)Click on the checkbox to Enable OAuth Settings.Provide a callback URL.In the Selected OAuth Scopes, make sure that refresh_token, api, cdp_query_api, cdp_profile_api is selected.Click on Save to save the connected appFrom the page that opens up, click on the Manage Consumer Details to find your client id and client secretFetching Refresh TokenFrom the connected app, note down the below details:Client IdClient SecretCallback URLObtain the codeFrom browser, go to the below url.<LOGIN_URL>/services/oauth2/authorize?response_type=code&client_id=<client_id>&redirect_uri=<callback_url>This will redirect you to the callback url. The redirected url will be of the form<callback url>?code=<CODE>Extract the CODE from the address bar to be used in next step. Check the network tab of browser if the addressbar doesn't show this.Get core and refresh tokensMake a post call using curl or postman to the below url using the code retrieved in previous step.<LOGIN_URL>/services/oauth2/token?code=<CODE>&grant_type=authorization_code&client_id=<clientId>&client_secret=<clientSecret>&redirect_uri=<callback_uri>The response to the above post call will be a json with access_token and refresh_token
Package: salesforce-dbsync
salesforce-dbsyncPython library to download data from Salesforce and synchronize with a relational databaseExampleThis example performs the following steps for Salesforce Object 'Account' when run for the first time:Downloads Table Metadata from SalesforceDownloads Table Data from Salesforce, limited to a maximum of 10000 rowsCreates a MySQL Database if one does not already existCreates Tables in MySQL alongwith Indexes if the Table does not already existUploads the data into the MySQL TableIn the subsequent runs, it performs the following steps:Downloads Table Data from SalesforceRefreshes data in MySQL with new records or updates that from SalesforceNote: Deletes in Salesforce are ignoredimportsysfromscreenwriterimportScreenwriterfromsalesforce_dbsyncimportSync_Managerdefdo_init():globalsw,sync_mgrsw=Screenwriter()db_creds={'user':'mysql_uid','passwd':'mysql_pwd','db':'TESTDB'}sf_creds={'user':'sf_uid','passwd':'pb_pwd','token':'sf_tok'}control_map={'min-SystemModstamp-date':'2019-01-01','dml-limit':10000}replace_map={}replace_map['UNWANTED-CHAR']=' 'control_map['char-replace-map']=replace_mapsync_mgr=Sync_Manager(sw,db_creds,sf_creds,control_map)defdo_main():globalsw,sync_mgrsync_mgr.add_sync_profile('Account',['Name','BillingStreet','BillingCountry'],["BillingCountry = 'Canada'"])sync_mgr.init_mysql()sync_mgr.init_sfdc()sync_mgr.create_missing_db_tables()sync_mgr.sync()do_init()do_main()
Package: salesforce_id_converter
# Salesforce Id converter[![PyPI](https://img.shields.io/pypi/v/nine.svg)](https://pypi.org/project/salesforce_id_converter/)
[![GitHub license](https://img.shields.io/github/license/amureki/salesforce_id_converter.svg)](https://github.com/amureki/salesforce_id_converter/blob/master/LICENSE)
[![Build Status](https://travis-ci.org/amureki/salesforce_id_converter.svg?branch=master)](https://travis-ci.org/amureki/salesforce_id_converter)Simply converts 15 character id into a 18 character id.
Visit [Salesforce StackExchange](http://salesforce.stackexchange.com/questions/1653/what-are-salesforce-ids-composed-of) article for details.## Usage:`bash pip install salesforce_id_converter sfc 00558000001N0Ke `And you will get the next output:`bash You converted 15 character `00558000001N0Ke` into 18 character: 00558000001N0KeAAK New id has been copied to your clipboard `
Package: salesforce-oauth-request
# Salesforce Oauth RequestA bit of Requests driven utility code to drive the Salesforce.com Oauth2 Web flow. Use this module to login to a Salesforce account using just the username and password. Good for tests and scripts which needSalesforce access_token access.## Installation```pip install salesforce-oauth-request```## UsageYou need a Connected App defined in Salesforce so that you have all these pieces of info:1. `client ID`2. `client secret`3. `redirect uri`Now you can get an `access_token` and `instance_url` like this:```import salesforce_oauth_requestresult = salesforce_oauth_request.login(username=username,password=password,client_id=client_id,client_secret=client_secret,redirect_uri=redirect_uri)print "Access token:  %s" + result['access_token']print "Refresh token: %s" + result['refresh_token']print "Instance URL:  %s" + result['instance_url']# Now use access_token, instance_url for REST, SOAP, or BULK API access.```## Options```cache_session=True/False - default False```Pass the option `cache_session=true` to save the access token to `~.sf_oauth`to save time on repeated runs.```sandbox=True/False - default False```Pass `sandbox=True` to use a sandbox login.## TestingYou can run the simple test script like this:```python test.py```It will prompt you for all the values, drive the login, and print the results.
Package: salesforce-oauth-request-yplan
A bit of Requests driven utility code to drive the Salesforce.com Oauth2
Web flow. Use this module to login to a Salesforce account using just
the username and password. Good for tests and scripts which need
Salesforce access_token access.Installationpipinstallsalesforce-oauth-request-yplanUsageYou need a Connected App defined in Salesforce so that you have all
these pieces of info:client IDclient secretredirect uriNow you can get anaccess_tokenandinstance_urllike this:importsalesforce_oauth_requestresult=salesforce_oauth_request.login(username=username,password=password,client_id=client_id,client_secret=client_secret,redirect_uri=redirect_uri)print"Access token:{}".format(result['access_token'])print"Refresh token:{}".format(result['refresh_token'])print"Instance URL:{}".format(result['instance_url'])# Now use access_token, instance_url for REST, SOAP, or BULK API access.Optionscache_session=True/False-defaultFalsePass the optioncache_session=trueto save the access token to~.sf_oauthto save time on repeated runs.sandbox=True/False-defaultFalsePasssandbox=Trueto use a sandbox login. ## TestingHistory1.1.1 (2016-07-14)Brought backHISTORY.rst.Changed package repository url to the fork.1.1.0 (2016-07-14)Python2 and Python3 compatibility.Forkedsalesforce-oauth-request-yplanpackage.
Package: salesforce-python
salesforce-pythonsalesforce-python is an API wrapper for Salesforce written in PythonInstallingpip install salesforce-pythonUsagefrom salesforce.client import Client

client = Client('CLIENT_KEY', 'CLIENT_SECRET', 'https://na50.salesforce.com/', 'v41.0') # Host must have trailing slashGet authorization urlurl = client.authorization_url('REDIRECT_URI')Exchange the code for a tokentoken = client.exchange_code('REDIRECT_URI', 'CODE')Set the tokenclient.set_access_token('TOKEN')Refresh the tokennew_token = client.refresh_token()Get user informationuser = client.get_user_info()Get API versionsuser = client.get_versions()Get all resources by the version specified in the client instantiation.versions = client.get_versions()Get all objects describedmetadata = client.get_describe_global()Get an objectobject = client.get_sobject('Lead)Create an objectdata = {'LastName': 'Doe', 'IsConverted': 'False', 'Status': 'Open - Not Contacted', 'IsUnreadByOwner': 'False', 'Company': 'NA', 'FirstName': 'John'}
response = client.create_sobject('Lead', data)Get an object describedmetadata = client.get_sobject_describe('Lead')WebhooksIn order to create a webhook in Salesforce we need to create an APEX Class, Remote Site and Apex Trigger.Create the APEX ClassIn this example we are going to read the apex_class.txt file in the files folder included in this repository:

with open(os.path.join('/path/to/apex_class.txt'), 'r') as file:
    body = file.read()

response = client.create_apex_class('WebhookClass', body)Create the Remote SiteURL is a string with the domain of your site:

url = 'https://mywebsite.com/'
response = client.create_remote_site('RemoteSiteSetting', url)Create the APEX TriggerTo create the Trigger, we are going to read the apex_trigger.txt file and replace some values.

with open(os.path.join('/path/to/apex_trigger.txt'), 'r') as file:
    body = file.read()

sobject = 'User'
event = 'after insert'
url = 'https://mywebsite.com/notification_url/' #This is the domain url + your webhook path

body = body.replace('{sobject}', sobject)
body = body.replace('{events}', event)
body = body.replace('{url}', "'" + url + "'")

response = client.create_apex_trigger('WebhookTrigger', body, sobject)That's all, you should receive notifications every time you create a new user in your Salesforce dashboard.RequirementsrequestsContributingWe are always grateful for any kind of contribution including but not limited to bug reports, code enhancements, bug fixes, and even functionality suggestions.You can report any bug you find or suggest new functionality with a newissue.If you want to add yourself some functionality to the wrapper:Fork it (https://github.com/GearPlug/salesforce-python)Create your feature branch (git checkout -b my-new-feature)Commit your changes (git commit -am 'Adds my new feature')Push to the branch (git push origin my-new-feature)Create a new Pull Request
Package: salesforce-python-sdk
salesforce-python-sdk=====================Salesforce Python SDK supports Salesforce REST and Partner SOAP APIs.Install-------python setup.py installExample-------import salesforce as sfsfdc = sf.Salesforce()sfdc.authenticate(client_id=client_id,client_secret=client_secret,username=username,password=password)#SOAP callsfdc.Contact.create([{'FirstName': 'John','LastName': 'Varges',},{'FirstName': 'Clark','LastName': 'Fisher',}],soap=True)#REST Callsfdc.Contact.create({'FirstName': 'John','LastName': 'Varges'})You can switch between REST and SOAP by passing soap parameter.Supported APIs--------------get_auth_uri(self, **kwargs)authenticate(self, soap=None, **kwargs)query(self, query_string, soap=None)query_all(self, query_string, soap=None)query_more(self, query_url, soap=None)search(self, search_string, soap=None)get(self, get_url, params=None, soap=None, **kwargs)post(self, post_url, data, soap=None)On sObject:describe(self, soap=None)create(self, data, soap=None)update(self, data, soap=None)delete(self, record_id, soap=None)post(self, data, record_id=None, soap=None)get(self, record_id=None, params=None, soap=None)
Package: salesforce-reporting
Get data straight from your Salesforce reports via python using the Analytics API.InstallInstall via pip:pip install salesforce-reportingExamplesAuthenticationConnect to the Salesforce Analytics API and request data from a report:import salesforce_reporting

my_sf = salesforce_reporting.Connection('your_id', 'your_secret',
'your_username', 'your_password', 'your_instance')
my_sf.get_report('report_id', includeDetails=True)Get records from reportUse the ReportParser to access all the records included in a report:report = my_sf.get_report('report_id', includeDetails=True)
parser = salesforce_reporting.ReportParser(report)

parser.records()Extract series from matrix reportFor a matrix report grouped across the top by Calendar Month doing:report = my_sf.get_report('report_id')
matrix_parser = salesforce_reporting.MatrixParser(report)

matrix_parser.series_down('May 2012')Will return all values for ‘May 2012’ as values in a dictionary with the row groupings as keys.Coming SoonSimplified Authentication processAccess to DashboardsAuthor & LicenseMIT License. Created by Chris Hall.
Package: salesforce-reporting-chunked
salesforce-reporting-chunkedGet > 2000 rows from Your Date-Sortable Salesforce Reportssalesforce-reporting-chunksis a wrapper aroundcghall'ssalesforce-reportingmodule. The Salesforce API limits output to 2000 rows for a given report.salesforce-reporting-chunkedworks around this limitation by returning a generator that simply pulls a date range from your report a given number of days at a time.Installpip install salesforce-reporting-chunkedDocumentationDocumentation atreadthedocs.UsageObtain a Salesforce security token.Choose your API versionGet your report id from the Salesforce report URLfromsalesforce_reporting_chunkedimportchunk_report_by_dateCONFIG={"security_token":"REPLACE WITH YOUR TOKEN","username":"REPLACE WITH YOUR USERNAME","password":"REPLACE WITH YOUR PASSWORD","api_version":"v38.0"}FIELDNAMES=["First Name","Last Name","Date Column",# this is the magic column use for chunking."Corhuscorrated Plethanth","Other Column",]REPORT_ID="YOURREPORTID">>>data=chunk_report_by_date(CONFIG,REPORT_ID,FIELDNAMES,date_fieldname="Date Column",start_date="2018-01-01",start_date="2019-01-31",)>>>next(data)OrderedDict([('First Name','Fred'),('Last Name','Garvin'),('DATE_COLUMN_NAME','2018-01-01'),('Corhuscorrated Plethanth',True),('Other Column':'Yep. Another')])