Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit 723bd4c

Browse files
committed
documentation updates
1 parent 36048f5 commit 723bd4c

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

README.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,27 @@ Example Usage
2727
creative = creatives[0]
2828
creative.title = 'shiny new title'
2929
# the session is inherited from `atomx` that made the get request
30-
creative.update()
30+
creative.save()
3131
3232
3333
# create a new profile
3434
from atomx.models import Profile
3535
profile = Profile(advertiser_id=23, name='test profile')
36-
# Note that you have to pass it a valid `Atomx` session for save
37-
# or use `atomx.save(profile)`
38-
profile.save(atomx)
36+
# Note that you have to pass it a valid `Atomx` session for create
37+
# or use `atomx.create(profile)`
38+
profile.create(atomx)
3939
4040
# now you could alter and update it like the creative above
4141
profile.name = 'changed name'
42-
profile.update()
42+
profile.save()
4343
4444
4545
# you can also get attributes
4646
profiles = atomx.get('advertiser/88/profiles')
4747
# profiles is now a list of `atomx.models.Profile` that you can
4848
# read, update, etc again.
4949
profiles[0].click_frequency_cap_per = 86400
50-
profiles[0].update()
50+
profiles[0].save()
5151
5252
5353
# working with search
@@ -62,17 +62,17 @@ Example Usage
6262
6363
# reporting example
6464
# get a report for a specific publisher
65-
report = atomx.report(type='publisher', sums=['impressions', 'clicks'], groups=['hour'], where=[['publisher_id', '==', 42]], from_='2015-02-08 00:00:00', to='2015-02-09 00:00:00', timezone='America/Los_Angeles')
65+
report = atomx.report(scope='publisher', groups=['hour_formatted'], sums=['impressions', 'clicks'], where=[['publisher_id', '==', 42]], from_='2015-02-08 00:00:00', to='2015-02-09 00:00:00', timezone='America/Los_Angeles')
6666
# check if report is ready
6767
print(report.is_ready)
6868
# if pandas is installed you can get the pandas dataframe with `report.pandas`
6969
# you can also get the report csv in `report.content` without pandas
7070
df = report.pandas
7171
# set index to datetime
7272
import pandas as pd
73-
df.index = pd.to_datetime(df.pop('hour'))
74-
# resample per day
75-
means = df.resample('D', how=['mean', 'median', 'std'])
73+
df.index = pd.to_datetime(df.pop('hour_formatted'))
74+
# calculate mean, median, std per hour
75+
means = df.resample('H', how=['mean', 'median', 'std'])
7676
# and plot impression and clicks per day
7777
means['impressions'].plot()
7878
means['clicks'].plot()

atomx/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,5 +216,5 @@ def pandas(self):
216216
'have to have pandas installed. '
217217
'Do `pip install pandas` in your command line.')
218218

219-
return pd.read_csv(StringIO(self.content),
219+
return pd.read_csv(StringIO(self.content), sep='\t',
220220
names=self.query.get('groups', []) + self.query.get('sums', []))

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
name='atomx',
2525
version=VERSION,
2626

27-
description='python interface for the https://api.atomx.com',
27+
description='python interface for the atomx api on https://api.atomx.com',
2828
long_description=README + '\n\n' + CHANGES,
2929

3030
packages=find_packages(),

0 commit comments

Comments
 (0)