Skip to main content

A small example package

Project description

sign_in_app

Unofficial Python library for the Sign In App API.

Before you do anything, you'll need to create a client for the Sign In App's API on their website.

Next, install the sign-in-app library.

pip install sign-in-app

Then you can use the boiler plate code below to interact with the API.

Create API object

def create_api_obj():
	from sign_in_app.sign_in_app import sign_in_app
	
	#These options match up with the terminology of the Sign In App.
	#Once you've created your client, it should be straight forward.
	
	base_url="your_base_url"
	client_key="your_client_key"
	connection_name="your_connection_name"
	secret_key="your_secret_key"
	
	#Instructs which sites to look at. You will need to specify this.
	# Locate Site IDs:
	#	Go to Manage
	#	Click on Sites
	#	Click on a site and check out the URL. There will be an ID there.
	
	site_ids=[1,2,3]#list of integers

	#Instructs which user groups to look at. You will need to specify this.
	# Locate Group IDs:
	#	Go to Manage
	#	Click on Groups
	#	Click on a group and check out the URL. There will be an ID there.
	
	group_ids=[1,2,3]#list of integers

	#Create api object.
	api=sign_in_app(
		site_ids=site_ids,
		base_url=base_url,
		connection_name=connection_name,
		client_key=client_key,
		secret_key=secret_key,
		group_ids=group_ids
		)

Visitor Objects

Once you've created an api object, you can call functions with it to return lists of visitor objects.

The visitor object has these attributes available:

{
#These are parent objects for the visitor object.
'site': <sign_in_app.site object at 0x01EC62C8>, 
'sign_in_app': <sign_in_app.sign_in_app object at 0x01EA0C10>, 

#This is the data the API returns.
'id': some_integer, #This is the id for the visit.
'group_id': some_integer, 
'returning_visitor_id': some_integer, #This is basically the user's ID.
'name': "Someone's Full Name", 
'photo_url': None, 
'badge_url': None, 
'status': 'signed_in', 
'in_datetime': '2021-04-29T13:39:57Z', 
'out_datetime': None, 
'expected_datetime': None, 
'additional_fields': {"Question 1":"Answer", "Question 2", "Answer"}, 
'role': None, 
'email': 'somebody@domain.com', 
'mobile': None, 
'c3YQ5d9wQi': "User's Department", 
'fQHRUCmOKz': "User's Job Title", 
'rejected_sign_in': False, 

#Custom fields added for convenience. Any suggestions, please get in contact.

#In and Out times converted to your local timezone. You can specify this timezone if needed.
'in_datetime_local': datetime.datetime(2021, 4, 29, 9, 39, 57, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=72000), 'Eastern Daylight Time')), 
'out_datetime_local': None,  
}

The library can give you today's data, or search historical data. Examples below.

get_today

visitors=api.get_today()
for visitor in visitors:
   print(visitor.__dict__)

get_history

Accurate to the day.

from datetime import datetime, timedelta
start_date=datetime.now()-timedelta(days=7)
end_date=datetime.now()
app_obj.get_history(start_date, end_date)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sign-in-app-0.0.3.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sign_in_app-0.0.3-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file sign-in-app-0.0.3.tar.gz.

File metadata

  • Download URL: sign-in-app-0.0.3.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.0

File hashes

Hashes for sign-in-app-0.0.3.tar.gz
Algorithm Hash digest
SHA256 96e34e8f88bd35e06a3cd5da25d522beedfb64d4a1f7a252ca24e7e77eee0b7c
MD5 aba28084a8a9f71527204c73b42acaa3
BLAKE2b-256 21643f75a4a9cc857bde6d50fff91153bf3d4155e18ed45b89e655dda4948cb3

See more details on using hashes here.

File details

Details for the file sign_in_app-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: sign_in_app-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.0

File hashes

Hashes for sign_in_app-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cb7742831ad1f232a6fa352367f90c647698d487c7e5f844b11374f6dd14f9bb
MD5 0d664c3556f0b7240809ee0538f2c15d
BLAKE2b-256 c1b23c4e24234fe6e5e6ace17befcfef2647de9d2e5e8352d912b32a23290d83

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page