Releases: Hashmap-Software-Agency/Pyttman
1.3.2
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 inmessage.entities
in therespond
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 theapp
instanceThe
app
instance in Pyttman apps now has allAbility
classes available by their exact name, as defined in thesettings.py
file. This is useful for scenarios where you want to access thestorage
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
What's Changed
- Updated README.md get started with commands by @erikhalt in #77
- Recursive assignment of fields in settings.py to the app.settings object by @RadarJam in #78
- Develop by @erikhalt in #80
- 81 static files directory in apps by @dotchetter in #83
- 11 improve logging by @dotchetter in #82
- no message by @dotchetter in #84
- Improve run file intent by @dotchetter in #85
New Contributors
Full Changelog: 1.3.0.1...1.3.1
1.3.0.1
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
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 theDecimal
type
and it's now supported in theEntityField
ecosystem in Pyttman.class EnterIncome(Intent): income = DecimalEntityField()
-
New mode in Pyttman CLI:
runfile
- Run single scripts with PyttmanSome 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 commandrunfile
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 atThis 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
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
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
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
- Fixes #69
Full Changelog: 1.2.0.3...1.2.0.4
1.2.0.3 - Hotfix for issue #68
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
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'.