Skip to content

Releases: Hashmap-Software-Agency/Pyttman

1.3.2

26 Dec 19:05
Compare
Choose a tag to compare

V 1.3.2

🌟 News

  • Removed clutter from log entries

    The log entries from Pyttman are now cleaner, without as much clutter for each log entry.

  • New argment to EntityField classes available: post_processor

    The post_processor argument allows you to define a function which will be called on the value of the entity after it has been parsed. This is useful for scenarios where you want to clean up the value of the entity, or perform other operations on it before it is stored in message.entities in the respond method.

    class SomeIntent(Intent):
        """
        In this example, the name will be stripped of any leading or trailing whitespace.
        """
        name = StringEntityField(default="", post_processor=lambda x: x.strip())  
  • All ability classes are now available by exact name on the app instance

    The app instance in Pyttman apps now has all Ability classes available by their exact name, as defined in the settings.py file. This is useful for scenarios where you want to access the storage object of an ability, or other properties of the ability.

       # ability.py
       class SomeAbility(Ability):
           pass
      
       # settings.py
       ABILITIES = [
           "some_ability.SomeAbility"
       ]
    
       # any file in the project
       from pyttman import app
         

🐛 Splatted bugs and corrected issues

  • Fixed a bug where LOG_TO_STDOUT didn't work, and logs were not written to STDOUT: #86

1.3.1

23 Dec 01:26
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 1.3.0.1...1.3.1

1.3.0.1

05 Feb 23:11
Compare
Choose a tag to compare

Hotfix release, addressing an issue with PyttmanCLI executing scripts,
where the directory of the app is included in the path for a script
twice.

1.3.0

05 Feb 22:39
Compare
Choose a tag to compare

V 1.3.0

In this release, we're introducing some cool new features along with
some bug fixes.
The star of the show this time is the test suite class for improved
testability of Pyttman applications.

🌟 News

  • Test suite class for developing tests

    A new Test suite class has been developed for use in Pyttman apps, for
    making it easier to write unit test for Pyttman applications. The test automatically
    loads the app context for the app in which the tests are created in.

    from pyttman.testing import PyttmanTestCase
    
    class TestUserSynchronizer(PyttmanTestCase):
    
      def setUp(self) -> None:
          # This setup hook works as with any TestCase class.        
          # You have access to your pyttman app just as if the app was running.
          app = self.app
    
      def test_some_func(self):
          self.fail()  
  • New EntityField class for Decimal type

    For finance and other domains, the floating point precision
    float isn't high enough. An industry standard is the Decimal type
    and it's now supported in the EntityField ecosystem in Pyttman.

    class EnterIncome(Intent):
      income = DecimalEntityField()
  • New mode in Pyttman CLI: runfile - Run single scripts with Pyttman

    Some times a single script does the job, or the app you've developed
    isn't designed to be conversational. For these situations, the new
    PyttmanCLI command runfile is perfect. It will invoke a Python file
    with the app loaded, providing you all the benefits of using Pyttman
    without having to develop your app with a conversational approach.

    # someapp/script.py
    
    from pyttman import app
    
    if __name__ == "__main__":
      print(f"Hello! I'm using {app.name} as context.")

    Running the file above with PyttmanCLI:

    $ pyttman runfile pyttman_app_name script.py
      
    > Hello! I'm using pyttman_app_name as context.
  • New mode in Pyttman CLI: -V - See the version you're at

    This mode is quite simple. It returns the version of the installed
    the version of the installation of Pyttman.

    pyttman -V
    1.3.0

🐛 Splatted bugs and corrected issues

  • Fixes problem where words with special characters where ignored in entities

1.2.1.1

07 Dec 22:06
Compare
Choose a tag to compare

V 1.2.1.1

This is a hotfix release, addressing an issue with the integration with discord.py 2.0 API
were Pyttman incorrectly parsed the 'channel' property for the message.

🐛 Splatted bugs and corrected issues

  • Fixes the discord integration

1.2.1

07 Dec 22:05
Compare
Choose a tag to compare

V 1.2.1

This release includes an important update for the discord client.
Any application using Pyttman will need to upgrade to this version for the
app to still work after new year 2023 due to Discord API changes.

🐛 Splatted bugs and corrected issues

  • Fixes #71
  • Reduced dependencies to 1/3 of previous versions, improving security and reducing dependency exposure.
  • Fixes various spelling errors in the code and comments

1.2.0.4

05 Nov 11:51
Compare
Choose a tag to compare

This is a hotfix release, fixing an issue with BoolEntityField instances
not parsing the values correctly if the sought word is also part of the
'lead' and/or 'trail' tuples.

🐛 Splatted bugs and corrected issues

Full Changelog: 1.2.0.3...1.2.0.4

1.2.0.3 - Hotfix for issue #68

05 Nov 00:22
Compare
Choose a tag to compare

This is a hotfix release, fixing an issue with default values in
TextEntityFields, causing a crash if it was combined with as_list=True, and
valid_strings.

1.2.0.2

09 Oct 18:21
Compare
Choose a tag to compare

This is a hotfix release, fixing an issue with EntityFields with valid_strings
configured combined with 'suffixes' and/or 'prefixes',
where the 'prefixes' and/or 'suffixes' were ignored, if an entity matched
a string mentioned in 'valid_strings'.

1.2.0.1

07 Oct 10:02
Compare
Choose a tag to compare

V 1.2.0.1

This is a hotfix release, fixing an issue with EntityFields with as_list
configured, where it would append an infinite amount of matching strings,
when in fact, it should only add as many as defined in span.

🐛 Splatted bugs and corrected issues