All key-path accessible payload keys from Twitter Activity Streams have been defined in a new module twitter_acs_fields.py. Each value is a accessible via an object that defines the path through the JSON payload to the appropriate value, which is stored in an attribute of the object. The twitter_acs_fields.py module handles the checks for existence of keys and stores a default value if the destination value isn't reached. This means the construction of the output for e.g. gnacs.py -z twitter is much cleaner.
Custom output (Twitter only)
The acscsv/ directory now includes a custom_output.py module that can be used for one-off projects with custom delimited output. To keep the master branch clean, the desired workflow is to pull all upstream changes to master, create a new branch, and mv or cp the custom_output.py module into one that is named appropriately for the task. The CustomCSV class inherits from the core AcsCSV class, so all of the helper methods and machinery are available to the custom class. For customized output fields and order, the developer only has to fill out the get_output_list() method defined in the new copy of the custom_output.py module. In this way, the developer can maintain a branch that includes any of their one-off projects, delete it at any point, or simply cherrypick from master when there are substantial changes there.
Unit testing
New modules have been added to the acscsv/ directory to implement Python's unit testing framework on each of the publisher-specific modules. For now, unittest boilerplate has been added to all modules, except for native-format Stocktwits, which includes ~10 test methods. The remaining modules should be filled out soon by other contributors.
Twitter extractors
All key-path accessible payload keys from Twitter Activity Streams have been defined in a new module
twitter_acs_fields.py
. Each value is a accessible via an object that defines the path through the JSON payload to the appropriate value, which is stored in an attribute of the object. Thetwitter_acs_fields.py
module handles the checks for existence of keys and stores a default value if the destination value isn't reached. This means the construction of the output for e.g.gnacs.py -z twitter
is much cleaner.Custom output (Twitter only)
The
acscsv/
directory now includes acustom_output.py
module that can be used for one-off projects with custom delimited output. To keep the master branch clean, the desired workflow is to pull all upstream changes to master, create a new branch, andmv
orcp
thecustom_output.py
module into one that is named appropriately for the task. TheCustomCSV
class inherits from the coreAcsCSV
class, so all of the helper methods and machinery are available to the custom class. For customized output fields and order, the developer only has to fill out theget_output_list()
method defined in the new copy of thecustom_output.py
module. In this way, the developer can maintain a branch that includes any of their one-off projects, delete it at any point, or simply cherrypick from master when there are substantial changes there.Unit testing
New modules have been added to the
acscsv/
directory to implement Python's unit testing framework on each of the publisher-specific modules. For now,unittest
boilerplate has been added to all modules, except for native-format Stocktwits, which includes ~10 test methods. The remaining modules should be filled out soon by other contributors.